Fashion-MNIST 2c2d¶
-
class
deepobs.fmnist.fmnist_2c2d.set_up(batch_size, weight_decay=None)[source]¶ Class providing the functionality for a vanilla CNN architecture on Fashion-MNIST adapted from the TensorFlow tutorial for MNIST.
It consists of two convolutional layers with ReLU activations, each followed by max-pooling, followed by one fully-connected layer with ReLU activations and a 10-unit output layer with softmax. The model uses cross-entroy loss and no regularization. The weight matrices are initialized with truncated normal (stddev=
0.05) and the biases are initialized to0.05.Parameters: - batch_size (int) -- Batch size of the data points. Defaults to
128. - weight_decay (float) -- Weight decay factor. In this model there is no weight decay implemented. Defaults to
None.
-
data_loading¶ Data loading class for Fashion-MNIST,
fmnist_input.data_loading.Type: deepobs.data_loading
-
losses¶ Tensor of size
batch_sizecontaining the individual losses per data point.Type: tf.Tensor
-
accuracy¶ Tensor containing the accuracy of the model.
Type: tf.Tensor
-
train_init_op¶ A TensorFlow operation to be performed before starting every training epoch.
Type: tf.Operation
-
train_eval_init_op¶ A TensorFlow operation to be performed before starting every training eval epoch.
Type: tf.Operation
-
test_init_op¶ A TensorFlow operation to be performed before starting every test evaluation phase.
Type: tf.Operation
-
bias_variable(name, shape, init_val)[source]¶ Creates a bias variable of given shape and initialized to a given value.
Parameters: - name (str) -- Name of the bias variable.
- shape (list) -- Dimensionality of the bias variable.
- init_val (float) -- Initial value of the bias variable.
Returns: Bias variable.
Return type: tf.Variable
-
conv2d(x, W, stride=1, padding='SAME')[source]¶ Creates a two dimensional convolutional layer on top of a given input.
Parameters: - x (tf.Variable) -- Input to the layer.
- W (tf.Variable) -- Weight variable of the convolutional layer.
- stride (int) -- Stride of the convolution. Defaults to
1. - padding (str) -- Padding of the convolutional layers. Can be
SAMEorVALID. Defaults toSAME.
Returns: Output after the convolutional layer.
Return type: tf.Variable
-
get()[source]¶ Returns the losses and the accuray of the model.
Returns: Tupel consisting of the losses and the accuracy. Return type: tupel
- batch_size (int) -- Batch size of the data points. Defaults to