to_categorical

to_categorical(y, nb_classes=None)

Convert class vector (integers from 0 to nb_classes) to binary class matrix, for use with categorical_crossentropy.

Arguments

  • y: class vector to be converted into a matrix
  • nb_classes: total number of classes

Returns

A binary matrix representation of the input.


convert_kernel

convert_kernel(kernel, dim_ordering='default')

Converts a kernel matrix (Numpy array) from Theano format to TensorFlow format (or reciprocally, since the transformation is its own inverse).