Python-ELM
Python-ELM copied to clipboard
I use ELMclassifier on MNIST, accuracy is 0.0
from elm import ELMClassifier import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', one_hot=True) train = mnist.train.next_batch(100) elmc = ELMClassifier(n_hidden=1000, activation_func='gaussian', alpha=0.0, random_state=0) elmc.fit(train[0], train[1]) test = mnist.test.next_batch(100) print('train acc is %g, test acc is %g ' %( elmc.score(train[0], train[1]), elmc.score(test[0], test[1])))
run and get this, train acc is 0, test acc is 0
You are setting alpha=0, which means that the activations of the MLP are ignored, as described in the docstring of ELMClassifier: https://github.com/dclambert/Python-ELM/blob/master/elm.py#L357
activation = alpha*mlp_activation + (1-alpha)*rbf_width*rbf_activation
With alpha=1, I get
train acc is 1, test acc is 0.07