Parameters¶
Default parameter: Constant
-
class
tensorforce.core.parameters.
Constant
(name, value, dtype, summary_labels=None)[source]¶ Constant hyperparameter.
Parameters: - name (string) – Module name (internal use).
- value (dtype-dependent) – Constant hyperparameter value (required).
- dtype ("bool" | "int" | "long" | "float") – Tensor type (required).
- summary_labels ('all' | iter[string]) – Labels of summaries to record (default: inherit value of parent module).
-
class
tensorforce.core.parameters.
Decaying
(name, dtype, unit, decay, initial_value, decay_steps, increasing=False, inverse=False, scale=1.0, summary_labels=None, **kwargs)[source]¶ Decaying hyperparameter.
Parameters: - name (string) – Module name (internal use).
- dtype ("bool" | "int" | "long" | "float") – Tensor type (required).
- unit ("timesteps" | "episodes" | "updates") – Unit of decay schedule (required).
- decay ("cosine" | "cosine_restarts" | "exponential" | "inverse_time" | "linear_cosine" | "linear_cosine_noisy" | "polynomial") – Decay type, see TensorFlow docs (required).
- initial_value (float) – Initial value (required).
- decay_steps (long) – Number of decay steps (required).
- increasing (bool) – Whether to subtract the decayed value from 1.0 (default: false).
- inverse (bool) – Whether to take the inverse of the decayed value (default: false).
- scale (float) – Scaling factor for (inverse) decayed value (default: 1.0).
- summary_labels ("all" | iter[string]) – Labels of summaries to record (default: inherit value of parent module).
- kwargs – Additional arguments depend on decay mechanism.
Cosine decay:- alpha (float) – Minimum learning rate value as a fraction of learning_rate (default: 0.0).
- t_mul (float) – Used to derive the number of iterations in the i-th period (default: 2.0).
- m_mul (float) – Used to derive the initial learning rate of the i-th period (default: 1.0).
- alpha (float) – Minimum learning rate value as a fraction of the learning_rate (default: 0.0).
- decay_rate (float) – Decay rate (required).
- staircase (bool) – Whether to apply decay in a discrete staircase, as opposed to continuous, fashion. (default: false).
- decay_rate (float) – Decay rate (required).
- staircase (bool) – Whether to apply decay in a discrete staircase, as opposed to continuous, fashion. (default: false).
- num_periods (float) – Number of periods in the cosine part of the decay (default: 0.5).
- alpha (float) – Alpha value (default: 0.0).
- beta (float) – Beta value (default: 0.001).
- decay_rate (float) – Decay rate (required).
- staircase (bool) – Whether to apply decay in a discrete staircase, as opposed to continuous, fashion. (default: false).
- initial_variance (float) – Initial variance for the noise (default: 1.0).
- variance_decay (float) – Decay for the noise's variance (default: 0.55).
- num_periods (float) – Number of periods in the cosine part of the decay (default: 0.5).
- alpha (float) – Alpha value (default: 0.0).
- beta (float) – Beta value (default: 0.001).
- final_value (float) – Final value (required).
- power (float) – Power of polynomial (default: 1.0, thus linear).
- cycle (bool) – Whether to cycle beyond decay_steps (default: false).
-
class
tensorforce.core.parameters.
OrnsteinUhlenbeck
(name, dtype, theta=0.15, sigma=0.3, mu=0.0, summary_labels=None)[source]¶ Ornstein-Uhlenbeck process.
Parameters: - name (string) – Module name (internal use).
- dtype ("bool" | "int" | "long" | "float") – Tensor type (required).
- theta (float > 0.0) – Theta value (default: 0.15).
- sigma (float > 0.0) – Sigma value (default: 0.3).
- mu (float) – Mu value (default: 0.0).
- summary_labels ('all' | iter[string]) – Labels of summaries to record (default: inherit value of parent module).
-
class
tensorforce.core.parameters.
PiecewiseConstant
(name, dtype, unit, boundaries, values, summary_labels=None)[source]¶ Piecewise-constant hyperparameter.
Parameters: - name (string) – Module name (internal use).
- dtype ("bool" | "int" | "long" | "float") – Tensor type (required).
- unit ("timesteps" | "episodes" | "updates") – Unit of interval boundaries (required).
- boundaries (iter[long]) – Strictly increasing interval boundaries for constant segments (required).
- values (iter[dtype-dependent]) – Interval values of constant segments, one more than (required).
- summary_labels ('all' | iter[string]) – Labels of summaries to record (default: inherit value of parent module).
-
class
tensorforce.core.parameters.
Random
(name, dtype, distribution, shape=(), summary_labels=None, **kwargs)[source]¶ Random hyperparameter.
Parameters: - name (string) – Module name (internal use).
- dtype ("bool" | "int" | "long" | "float") – Tensor type (required).
- distribution ("normal" | "uniform") – Distribution type for random hyperparameter value (required).
- shape (iter[int > 0]) – Tensor shape (default: scalar).
- summary_labels ('all' | iter[string]) – Labels of summaries to record (default: inherit value of parent module).
- kwargs – Additional arguments dependent on distribution type.
Normal distribution:- mean (float) – Mean (default: 0.0).
- stddev (float > 0.0) – Standard deviation (default: 1.0).
- minval (int / float) – Lower bound (default: 0 / 0.0).
- maxval (float > minval) – Upper bound (default: 1.0 for float, required for int).