Open gitndlaity opened 4 years ago
import gym from baselines import deepq import balance_bot
def callback(lcl, glb):
#is_solved = lcl['t'] > 100 and sum(lcl['episode_rewards'][-101:-1]) / 100 >= 199
is_solved = lcl['episode_rewards'][-1] >= 10
print('\r Current Score {} current status {}'.format(lcl['episode_rewards'][-1], is_solved),end=' ')
return is_solved
def main():
env = gym.make("balancebot-v0") # <-- this we need to create
# create the learning agent
#model = deepq.models.mlp([16, 16])
# train the agent on the environment
act = deepq.learn(
env, network='mlp', lr=1e-3,
total_timesteps=200000, buffer_size=50000, exploration_fraction=0.5,
exploration_final_eps=0.02, print_freq=5, callback=callback
)
# save trained model
act.save("balance.pkl")
if name == 'main': main()
comment model = deepq.models.mlp([16, 16])
and assign network parameter to 'mlp' and change to total_timesteps
according to new update gym environment
Thanks, Sir it's working very well.
Le sam. 9 mai 2020 à 14:52, Aakash Kumar notifications@github.com a écrit :
comment model = deepq.models.mlp([16, 16]) and assign network parameter to 'mlp' and change to total_timesteps according to new update gym environment
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yconst/balance-bot/issues/2#issuecomment-626117659, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL5YPU4ZLNDUFVXM52SKFCLRQT4ULANCNFSM4MQUQZOQ .
-- Merci cordialemt
Hello, What can we do in that case Thank You![Screenshot from 2020-04-25 15-59-38](https://user-images.githubusercontent.com/50038739/80274596-2350a100-870e-11ea-9f49-6d7df4870b01.png)