tfmdp.model.cell package¶
Submodules¶
tfmdp.model.cell.basic_cell module¶
-
class
tfmdp.model.cell.basic_cell.
BasicMarkovCell
(compiler: rddl2tf.compiler.Compiler, policy: tfmdp.policy.drp.DeepReactivePolicy, config: Optional[Dict] = None)¶ Bases:
tensorflow.python.ops.rnn_cell_impl.RNNCell
BasicMarkovCell implements a 1-step MDP transition function as an RNNCell whose hidden state is the MDP current state and output is a tuple with next state, action, intermediate fluents, and reward.
Parameters: - compiler (
rddl2tf.compiler.Compiler
) – RDDL2TensorFlow compiler. - config (Dict) – The cell configuration parameters.
-
__call__
(inputs: tensorflow.python.framework.ops.Tensor, state: Sequence[tensorflow.python.framework.ops.Tensor], scope: Optional[str] = None) → Tuple[Tuple[Sequence[tensorflow.python.framework.ops.Tensor], Sequence[tensorflow.python.framework.ops.Tensor], Sequence[tensorflow.python.framework.ops.Tensor], tensorflow.python.framework.ops.Tensor], Sequence[tensorflow.python.framework.ops.Tensor]]¶ Returns the cell’s output tuple and next state tensors.
Output tuple packs together the next state, action, interms, and reward tensors in order.
Parameters: - inputs (tf.Tensor) – The timestep input tensor.
- state (Sequence[tf.Tensor]) – The current state tensors.
- scope (Optional[str]) – The cell name scope.
Returns: A pair with the cell’s output tuple and next state.
Return type: (CellOutput, CellState)
-
action_size
¶ Returns the MDP action size.
-
graph
¶ Returns the cell’s computation graph.
-
interm_size
¶ Returns the MDP intermediate state size.
-
output_size
¶ Returns the simulation cell output size.
-
state_size
¶ Returns the MDP state size.
- compiler (
-
class
tfmdp.model.cell.basic_cell.
OutputTuple
(state, action, interms, reward)¶ Bases:
tuple
-
__getnewargs__
()¶ Return self as a plain tuple. Used by copy and pickle.
-
static
__new__
(_cls, state, action, interms, reward)¶ Create new instance of OutputTuple(state, action, interms, reward)
-
__repr__
()¶ Return a nicely formatted representation string
-
_asdict
()¶ Return a new OrderedDict which maps field names to their values.
-
classmethod
_make
(iterable, new=<built-in method __new__ of type object>, len=<built-in function len>)¶ Make a new OutputTuple object from a sequence or iterable
-
_replace
(**kwds)¶ Return a new OutputTuple object replacing specified fields with new values
-
action
¶ Alias for field number 1
-
interms
¶ Alias for field number 2
-
reward
¶ Alias for field number 3
-
state
¶ Alias for field number 0
-
-
tfmdp.model.cell.basic_cell.
cell_size
(sizes: Sequence[Sequence[int]]) → Sequence[Union[Sequence[int], int]]¶
-
tfmdp.model.cell.basic_cell.
to_tensor
(fluents)¶