MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / train

Method train

rl3/a2c/a2c.py:72–79  ·  view source on GitHub ↗
(states, rewards, actions, values)

Source from the content-addressed store, hash-verified

70 _train = trainer.apply_gradients(grads_and_params)
71
72 def train(states, rewards, actions, values):
73 advs = rewards - values
74 feed_dict = {train_model.X: states, A: actions, ADV: advs, R: rewards, LR: lr}
75 policy_loss, value_loss, policy_entropy, _ = sess.run(
76 [pg_loss, vf_loss, entropy, _train],
77 feed_dict
78 )
79 return policy_loss, value_loss, policy_entropy
80
81 def save(save_path):
82 ps = sess.run(params)

Callers 5

learnFunction · 0.95
trainFunction · 0.45
trainFunction · 0.45
spark.pyFile · 0.45
spark2.pyFile · 0.45

Calls 1

runMethod · 0.45

Tested by

no test coverage detected