Giter Club home page Giter Club logo

dcmocanu / sparse-evolutionary-artificial-neural-networks Goto Github PK

View Code? Open in Web Editor NEW
237.0 23.0 62.0 68.6 MB

Always sparse. Never dense. But never say never. A Sparse Training repository for the Adaptive Sparse Connectivity concept and its algorithmic instantiation, i.e. Sparse Evolutionary Training, to boost Deep Learning scalability on various aspects (e.g. memory and computational time efficiency, representation and generalization power).

Home Page: https://www.nature.com/articles/s41467-018-04316-3

License: MIT License

Python 59.50% HTML 40.50%
artificial-neural-networks sparse-neural-networks restricted-boltzmann-machine multi-layer-perceptron deep-learning deep-neural-networks neuroevolution complex-networks evolutionary-algorithms randomization

sparse-evolutionary-artificial-neural-networks's People

Contributors

dcmocanu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sparse-evolutionary-artificial-neural-networks's Issues

NaN on experiment for nmist data.

Hello.
I am trying to use your SET MLP implementation in a bunch of data from NMIST. I load the data with the following function I wrote:

def load_fashion_mnist_data(no_training_samples, no_testing_samples, filepath):

    data = np.load(filepath)

    x = data['Y_train']
    index_train = np.arange(data["X_train"].shape[0])
    np.random.shuffle(index_train)

    index_test = np.arange(data["X_test"].shape[0])
    np.random.shuffle(index_test)

    x_train = data["X_train"][index_train[0:no_training_samples], :]
    y_train = data["Y_train"][index_train[0:no_training_samples], :]
    x_test = data["X_test"][index_test[0:no_testing_samples], :]
    y_test = data["Y_test"][index_test[0:no_testing_samples], :]

    # normalize in 0..1
    x_train = x_train / 255.
    x_test = x_test / 255.

    return x_train.astype('float64'), y_train.astype('float64'), x_test.astype('float64'), y_test.astype('float64')

After a couple of epochs I come up with this error in the operation:
self.pdw[index] = self.momentum * self.pdw[index] - self.learning_rate * dw

Full traceback:

Traceback (most recent call last):
  File "C:\Users\rroman\projects\Py\old\set_mlp (2).py", line 585, in <module>
    metrics = set_mlp.fit(x_train, y_train, x_test, y_test, loss=CrossEntropy, epochs=no_training_epochs, batch_size=batch_size, learning_rate=learning_rate,
  File "C:\Users\rroman\projects\Py\old\set_mlp (2).py", line 309, in fit
    self._back_prop(z, a, masks,  y_[k:l])
  File "C:\Users\rroman\projects\Py\old\set_mlp (2).py", line 242, in _back_prop
    self._update_w_b(k, v[0], v[1])
  File "C:\Users\rroman\projects\Py\old\set_mlp (2).py", line 258, in _update_w_b
    self.pdw[index] = self.momentum * self.pdw[index] - self.learning_rate * dw
  File "C:\Users\rroman\AppData\Roaming\Python\Python39\site-packages\scipy\sparse\base.py", line 543, in __rmul__   
    return self.__mul__(other)
  File "C:\Users\rroman\AppData\Roaming\Python\Python39\site-packages\scipy\sparse\base.py", line 475, in __mul__    
    return self._mul_scalar(other)
  File "C:\Users\rroman\AppData\Roaming\Python\Python39\site-packages\scipy\sparse\data.py", line 124, in _mul_scalar
    return self._with_data(self.data * other)
FloatingPointError: underflow encountered in multiply

I am guessing that there's a number in one of the arrays that gets smaller and smaller and smaller. Is there somebody around that could give me a hand to prevent this from happening?

Provide Pytorch implementation

Is it possible to provide a Pytorch implementation of a custom sparse layer? For motivation, consider https://github.com/AlliedToasters/synapses . I think you can improve on it with some of the finer points that you must know. It is standard practice for researchers these days to provide a Pytorch implementation. The goal is to be able to integrate an efficient implementation of this custom layer into other general Pytorch code. If not, feel free to close this issue. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.