Networks

Default network: LayeredNetwork with default argument layers

class tensorforce.core.networks.AutoNetwork(name, inputs_spec, size=64, depth=2, final_size=None, final_depth=1, internal_rnn=False, device=None, summary_labels=None, l2_regularization=None)[source]

Network which is automatically configured based on its input tensors, offering high-level customization (specification key: auto).

Parameters:
  • name (string) – Network name (internal use).
  • inputs_spec (specification) – Input tensors specification (internal use).
  • size (int > 0) – Layer size, before concatenation if multiple states (default: 64).
  • depth (int > 0) – Number of layers per state, before concatenation if multiple states (default: 2).
  • final_size (int > 0) – Layer size after concatenation if multiple states (default: layer size).
  • final_depth (int > 0) – Number of layers after concatenation if multiple states (default: 1).
  • internal_rnn (false | parameter, long >= 0) – Whether to add an internal state LSTM cell as last layer, and if so, horizon of the LSTM for truncated backpropagation through time (default: false).
  • device (string) – Device name (default: inherit value of parent module).
  • summary_labels ('all' | iter[string]) – Labels of summaries to record (default: inherit value of parent module).
  • l2_regularization (float >= 0.0) – Scalar controlling L2 regularization (default: inherit value of parent module).
class tensorforce.core.networks.LayeredNetwork(name, layers, inputs_spec, device=None, summary_labels=None, l2_regularization=None)[source]

Network consisting of Tensorforce layers, which can be specified as either a list of layer specifications in the case of a standard sequential layer-stack architecture, or as a list of list of layer specifications in the case of a more complex architecture consisting of multiple sequential layer-stacks (specification key: custom or layered).

Parameters:
  • name (string) – Network name (internal use).
  • layers (iter[specification] | iter[iter[specification]]) – Layers configuration, see layers (required).
  • inputs_spec (specification) – Input tensors specification (internal use).
  • device (string) – Device name (default: inherit value of parent module).
  • summary_labels ('all' | iter[string]) – Labels of summaries to record (default: inherit value of parent module).
  • l2_regularization (float >= 0.0) – Scalar controlling L2 regularization (default: inherit value of parent module).