2D Data Set

class deepobs.tensorflow.datasets.two_d.two_d(batch_size, train_size=10000, noise_level=1.0)[source]

DeepOBS data set class to create two dimensional stochastic testproblems.

This toy data set consists of a fixed number (train_size) of iid draws from two scalar zero-mean normal distributions with standard deviation specified by the noise_level.
Parameters:
  • batch_size (int) -- The mini-batch size to use. Note that, if batch_size is not a divider of the dataset size (1000 for train and test) the remainder is dropped in each epoch (after shuffling).
  • train_size (int) -- Size of the training data set. This will also be used as the train_eval and test set size. Defaults to 10000.
  • noise_level (float) -- Standard deviation of the data points around the mean. The data points are drawn from a Gaussian distribution. Defaults to 1.0.
batch

A tuple (x, y) of tensors with random x and y that can be used to create a noisy two dimensional testproblem. Executing these tensors raises a tf.errors.OutOfRangeError after one epoch.

train_init_op

A tensorflow operation initializing the dataset for the training phase.

train_eval_init_op

A tensorflow operation initializing the testproblem for evaluating on training data.

test_init_op

A tensorflow operation initializing the testproblem for evaluating on test data.

phase

A string-value tf.Variable that is set to "train", "train_eval" or "test", depending on the current phase. This can be used by testproblems to adapt their behavior to this phase.