Skip to content
This repository has been archived by the owner on Mar 6, 2021. It is now read-only.

I use ELMclassifier on MNIST, accuracy is 0.0 #14

Open
namedysx opened this issue Sep 23, 2018 · 1 comment
Open

I use ELMclassifier on MNIST, accuracy is 0.0 #14

namedysx opened this issue Sep 23, 2018 · 1 comment

Comments

@namedysx
Copy link

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

@javiribera
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants