rtbgym.utils#

Useful tools.

Functions

check_array

Input validation on array.

sigmoid

Sigmoid function

Classes

NormalDistribution

Class to sample from normal distribution.

class rtbgym.utils.NormalDistribution(mean, std, random_state=None)[source]#

Class to sample from normal distribution.

Parameters:
  • mean ({int, float, array-like}) – Mean parameter of the normal distribution.

  • std ({int, float, array-like}) – Standard deviation of the normal distribution.

  • random_state (int, default=None (>= 0)) – Random state.

Attributes:
random_state

Methods

sample([size])

Sample random variables from the pre-determined normal distribution.

sample(size=1)[source]#

Sample random variables from the pre-determined normal distribution.

Parameters:

size (int, default=1 (> 0)) – Total number of the random variable to sample.

Returns:

random_variables – Random variables sampled from the normal distribution.

Return type:

ndarray of shape (size, )

rtbgym.utils.sigmoid(x)[source]#

Sigmoid function

rtbgym.utils.check_array(array, name, expected_dim=1, expected_dtype=None, min_val=None, max_val=None)[source]#

Input validation on array.

Parameters:
  • array (object) – Input array to check.

  • name (str) – Name of the input array.

  • expected_dim (int, default=1) – Expected dimension of the input array.

  • expected_dtype ({type, tuple of type}, default=None) – Expected dtype of the input array.

  • min_val (float, default=None) – Minimum value allowed in the input array.

  • max_val (float, default=None) – Maximum value allowed in the input array.