Data Generators

Here is a list of classes in the package.

Overview:

class neural_network.NormalDataGenerator(function: Callable[[float], Any] | Callable[[float, float], Any] | Callable[[float, float, float], Any] | Callable[[float, float, float, float], Any], num_datapoints: int, means: List[float], std_devs: List[float])[source]

Class to randomly generate datapoints and categorise them according to a given rule, or provide an output value if we are regressing, with data being generated via a normal distribution.

__init__(function: Callable[[float], Any] | Callable[[float, float], Any] | Callable[[float, float, float], Any] | Callable[[float, float, float, float], Any], num_datapoints: int, means: List[float], std_devs: List[float])[source]

Constructor method

Parameters:
  • function (custom_type) – A rule which takes a certain number of coordinates and returns a value representing the class or function value of the datapoint

  • num_datapoints (int) – The number of datapoints to be generated

  • means (List[float]) – A list of means for each coordinate

  • std_devs (List[float]) – A list of standard deviations for each coordinate

_generate_data()[source]

To generate normally distributed data

class neural_network.UniformDataGenerator(function: Callable[[float], Any] | Callable[[float, float], Any] | Callable[[float, float, float], Any] | Callable[[float, float, float, float], Any], num_datapoints: int, lower_bounds: List[float], upper_bounds: List[float])[source]

Class to randomly generate datapoints and categorise them according to a given rule, or provide an output value if we are regressing, with data being generated via a uniform distribution.

__init__(function: Callable[[float], Any] | Callable[[float, float], Any] | Callable[[float, float, float], Any] | Callable[[float, float, float, float], Any], num_datapoints: int, lower_bounds: List[float], upper_bounds: List[float])[source]

Constructor method

Parameters:
  • function (custom_type) – A rule which takes a certain number of coordinates and returns a value representing the class or function output of the datapoint

  • num_datapoints (int) – The number of datapoints to be generated

  • lower_bounds (List[float]) – A list of lower bounds for each coordinate

  • upper_bounds (List[float]) – A list of upper bounds for each coordinate

_generate_data()[source]

To generate uniformly distributed data