From 4cf7dc96443af88d3f629228528a22f4fac93812 Mon Sep 17 00:00:00 2001 From: John Schulman Date: Sun, 30 Sep 2018 14:54:44 -0700 Subject: [PATCH] Big refactor (#124) * massive revision inspired by soup: algo folder works * porting rl commands, WIP * various * git subrepo push --remote=git@github.com:openai/codegen.git --branch=refactor codegen subrepo: subdir: "codegen" merged: "aa27e069" upstream: origin: "git@github.com:openai/codegen.git" branch: "refactor" commit: "aa27e069" git-subrepo: version: "0.4.0" origin: "git@github.com:ingydotnet/git-subrepo.git" commit: "74339e8" * various * rewrite RL stuff in new framework * fix almost everything * woohoo tests pass * more tests * reformatting * fixes * write tests for embeddings * re-remove cg2 * pylint * minor * move smooth_helpers import; seems to cause nondeterministic failure in parallel pytest --- baselines/common/distributions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/baselines/common/distributions.py b/baselines/common/distributions.py index 8366eb5edc..491b9ff9be 100644 --- a/baselines/common/distributions.py +++ b/baselines/common/distributions.py @@ -53,6 +53,9 @@ def param_placeholder(self, prepend_shape, name=None): def sample_placeholder(self, prepend_shape, name=None): return tf.placeholder(dtype=self.sample_dtype(), shape=prepend_shape+self.sample_shape(), name=name) + def __eq__(self, other): + return (type(self) == type(other)) and (self.__dict__ == other.__dict__) + class CategoricalPdType(PdType): def __init__(self, ncat): self.ncat = ncat