data_utils module

data_utils.generate_linear_regression_dataset(m, b, std, n, seed=None)

Generate one-dimensional data with linear trend.

Parameters
  • m (float) – Slope of line.

  • b (float) – Y-intercept of line.

  • std (float) – Standard deviation of random error.

  • n (int) – The number of data points.

  • seed (int) – Random seed.

Returns

Tuple of numpy.ndarrays of x and y.

Return type

tuple

Notes

None

data_utils.generate_non_linear_regression_dataset(b, std, n, seed=None)

Generate one-dimensional data with linear trend.

Parameters
  • b (float) – Y-intercept of curve.

  • std (float) – Standard deviation of random error.

  • n (int) – The number of data points.

  • seed (int) – Random seed.

Returns

Tuple of numpy.ndarrays of x and y.

Return type

tuple

Notes

None

data_utils.load_cfar10_batch(path)

Loads a batch of the CIFAR-10 dataset.

Parameters

path (str) – Path to the data batch.

Returns

  • features (numpy.ndarray) – Shape is (number of data points, width of image, height of image, number of channels) For instance: (10000, 32, 32, 3) The width and height might be the other way around.

  • labels (numpy.ndarray) – Shape is (number of data points, ). For instance: (10000, ). Includes between 0-9.

Notes

Based on: https://towardsdatascience.com/cifar-10-image-classification-in-tensorflow-5b501f7dc77c

data_utils.load_label_names()

Loads the label names in the CIFAR-10 dataset.

Parameters

None

Returns

The labels as strings - 10 labels corresponding to 0-9.

Return type

list

Notes

None