Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

Commit

Permalink
Fix: Propagate kwargs properly
Browse files Browse the repository at this point in the history
  • Loading branch information
coord-e committed Jan 16, 2019
1 parent 4daeff5 commit b03d1cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trainer/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def step(weights):
return reward, weights, state


def train(scene, motion, robot, chunk_length=3, num_iteration=500, num_chunk=100, weight_factor=0.01):
def train(scene, motion, robot, chunk_length=3, num_iteration=500, num_chunk=100, weight_factor=0.01, **kwargs):
chunk_duration = scene.dt * chunk_length

num_frames = int(motion.length() / scene.dt)
Expand All @@ -84,7 +84,7 @@ def train(scene, motion, robot, chunk_length=3, num_iteration=500, num_chunk=100
in_weights = [weights[i % num_frames] for i in r]
print("start training chunk {} ({}~)".format(chunk_idx, start))
reward, out_weights, last_state = train_chunk(
scene, motion, robot, start, in_weights, last_state, num_iteration, weight_factor)
scene, motion, robot, start, in_weights, last_state, num_iteration, weight_factor, **kwargs)
for i, w in zip(r, out_weights):
weights[i % num_frames] = w

Expand Down

0 comments on commit b03d1cd

Please sign in to comment.