tensorforce.core.baselines package

Submodules

tensorforce.core.baselines.aggregated_baseline module

class tensorforce.core.baselines.aggregated_baseline.AggregatedBaseline(baselines, scope='aggregated-baseline', summary_labels=())

Bases: tensorforce.core.baselines.baseline.Baseline

Baseline which aggregates per-state baselines.

get_summaries()
get_variables(include_non_trainable=False)
tf_predict(states, update)
tf_regularization_loss()

tensorforce.core.baselines.baseline module

class tensorforce.core.baselines.baseline.Baseline(scope='baseline', summary_labels=None)

Bases: object

Base class for baseline value functions.

static from_spec(spec, kwargs=None)

Creates a baseline from a specification dict.

get_summaries()

Returns the TensorFlow summaries reported by the baseline

Returns:List of summaries
get_variables(include_non_trainable=False)

Returns the TensorFlow variables used by the baseline.

Returns:List of variables
tf_loss(states, reward, update)

Creates the TensorFlow operations for calculating the L2 loss between predicted state values and actual rewards.

Parameters:
  • states – State tensors
  • reward – Reward tensor
  • update – Boolean tensor indicating whether this call happens during an update.
Returns:

Loss tensor

tf_predict(states, update)

Creates the TensorFlow operations for predicting the value function of given states. :param states: State tensors :param update: Boolean tensor indicating whether this call happens during an update.

Returns:State value tensor
tf_regularization_loss()

Creates the TensorFlow operations for the baseline regularization loss/

Returns:Regularization loss tensor

tensorforce.core.baselines.cnn_baseline module

class tensorforce.core.baselines.cnn_baseline.CNNBaseline(conv_sizes, dense_sizes, scope='cnn-baseline', summary_labels=())

Bases: tensorforce.core.baselines.network_baseline.NetworkBaseline

CNN baseline (single-state) consisting of convolutional layers followed by dense layers.

tensorforce.core.baselines.mlp_baseline module

class tensorforce.core.baselines.mlp_baseline.MLPBaseline(sizes, scope='mlp-baseline', summary_labels=())

Bases: tensorforce.core.baselines.network_baseline.NetworkBaseline

Multi-layer perceptron baseline (single-state) consisting of dense layers.

tensorforce.core.baselines.network_baseline module

class tensorforce.core.baselines.network_baseline.NetworkBaseline(network_spec, scope='network-baseline', summary_labels=())

Bases: tensorforce.core.baselines.baseline.Baseline

Baseline based on a TensorForce network, used when parameters are shared between the value function and the baseline.

get_summaries()
get_variables(include_non_trainable=False)
tf_predict(states, update)
tf_regularization_loss()

Creates the TensorFlow operations for the baseline regularization loss.

Returns:Regularization loss tensor

Module contents

class tensorforce.core.baselines.Baseline(scope='baseline', summary_labels=None)

Bases: object

Base class for baseline value functions.

static from_spec(spec, kwargs=None)

Creates a baseline from a specification dict.

get_summaries()

Returns the TensorFlow summaries reported by the baseline

Returns:List of summaries
get_variables(include_non_trainable=False)

Returns the TensorFlow variables used by the baseline.

Returns:List of variables
tf_loss(states, reward, update)

Creates the TensorFlow operations for calculating the L2 loss between predicted state values and actual rewards.

Parameters:
  • states – State tensors
  • reward – Reward tensor
  • update – Boolean tensor indicating whether this call happens during an update.
Returns:

Loss tensor

tf_predict(states, update)

Creates the TensorFlow operations for predicting the value function of given states. :param states: State tensors :param update: Boolean tensor indicating whether this call happens during an update.

Returns:State value tensor
tf_regularization_loss()

Creates the TensorFlow operations for the baseline regularization loss/

Returns:Regularization loss tensor
class tensorforce.core.baselines.AggregatedBaseline(baselines, scope='aggregated-baseline', summary_labels=())

Bases: tensorforce.core.baselines.baseline.Baseline

Baseline which aggregates per-state baselines.

get_summaries()
get_variables(include_non_trainable=False)
tf_predict(states, update)
tf_regularization_loss()
class tensorforce.core.baselines.NetworkBaseline(network_spec, scope='network-baseline', summary_labels=())

Bases: tensorforce.core.baselines.baseline.Baseline

Baseline based on a TensorForce network, used when parameters are shared between the value function and the baseline.

get_summaries()
get_variables(include_non_trainable=False)
tf_predict(states, update)
tf_regularization_loss()

Creates the TensorFlow operations for the baseline regularization loss.

Returns:Regularization loss tensor
class tensorforce.core.baselines.MLPBaseline(sizes, scope='mlp-baseline', summary_labels=())

Bases: tensorforce.core.baselines.network_baseline.NetworkBaseline

Multi-layer perceptron baseline (single-state) consisting of dense layers.

class tensorforce.core.baselines.CNNBaseline(conv_sizes, dense_sizes, scope='cnn-baseline', summary_labels=())

Bases: tensorforce.core.baselines.network_baseline.NetworkBaseline

CNN baseline (single-state) consisting of convolutional layers followed by dense layers.