crazydonkey200 / neural-symbolic-machines

Neural Symbolic Machines is a framework to integrate neural networks and symbolic representations using reinforcement learning, with applications in program synthesis and semantic parsing.
Apache License 2.0
377 stars 69 forks source link

`scale_rewards` function uses undefined variables #2

Closed agarwl closed 6 years ago

agarwl commented 6 years ago
def scale_rewards(samples, scale):
  """Weight each samples with the weight. Reflected on rewards."""
  scaled_rewards = [list(scale * np.array(s.rewards)) for s in samples]
  new_samples = []
  for s, p in zip(samples, scaled_probs):
    new_samples.append(
        sample._replace(traj=traj._replace(rewards=scaled_rewards)))
  return new_samples

In the function in agent_factory.py, the variables sample and scaled_probs are undefined.

crazydonkey200 commented 6 years ago

Thanks for pointing this out! Just fixed it here https://github.com/crazydonkey200/neural-symbolic-machines/commit/95195067abcbf5df6a28b7d8dc0aab73e0d90a8d.

crazydonkey200 commented 6 years ago

Closing for now.