How to use the yarl.spaces.Dict function in yarl

To help you get started, we’ve selected a few yarl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rlgraph / rlgraph / examples / memory_example.py View on Github external
def __init__(self, *args, **kwargs):
        super(Memory, self).__init__(*args, **kwargs)
        self.record_space = Dict(
            state=Dict(state1=float, state2=float),
            reward=float
        )
        self.memory = self.get_variable("memory", trainable=False, from_space=self.record_space)
        self.index = self.get_variable("index", trainable=False, dtype=int)
        self.capacity = 5
        # TODO: put this into splitter component:
        self.var_list = [self.memory["state"]["state1"], self.memory["state"]["state2"], self.memory["reward"]]

        # TODO: this is normally done automatically by Component (see commented-out code below)
        self.insert = autograph.to_graph(self.computation_insert, verbose=True, partial_types={int})  #, partial_types={str, tuple})
        #self.define_inputs("record")
github rlgraph / rlgraph / examples / memory_example.py View on Github external
def __init__(self, *args, **kwargs):
        super(Memory, self).__init__(*args, **kwargs)
        self.record_space = Dict(
            state=Dict(state1=float, state2=float),
            reward=float
        )
        self.memory = self.get_variable("memory", trainable=False, from_space=self.record_space)
        self.index = self.get_variable("index", trainable=False, dtype=int)
        self.capacity = 5
        # TODO: put this into splitter component:
        self.var_list = [self.memory["state"]["state1"], self.memory["state"]["state2"], self.memory["reward"]]

        # TODO: this is normally done automatically by Component (see commented-out code below)
        self.insert = autograph.to_graph(self.computation_insert, verbose=True, partial_types={int})  #, partial_types={str, tuple})
        #self.define_inputs("record")