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

Method copy_from

rl2/atari/dqn_tf.py:212–222  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

210
211
212 def copy_from(self, other):
213 mine = [t for t in tf.trainable_variables() if t.name.startswith(self.scope)]
214 mine = sorted(mine, key=lambda v: v.name)
215 theirs = [t for t in tf.trainable_variables() if t.name.startswith(other.scope)]
216 theirs = sorted(theirs, key=lambda v: v.name)
217
218 ops = []
219 for p, q in zip(mine, theirs):
220 op = p.assign(q)
221 ops.append(op)
222 self.session.run(ops)
223
224
225 def save(self):

Callers 1

play_oneFunction · 0.45

Calls 1

runMethod · 0.45

Tested by

no test coverage detected