GithubHelp home page GithubHelp logo

ann's Introduction

Installation

$ cmake .
$ make

Usage

Training

$ ./train [path/to/config.json]

Autoencoder

$ ./autoencode_classify [path/to/config.json]

ann's People

Contributors

andregri avatar ralampay avatar shalinsirwani 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ann's Issues

Autoencoder Mode

  • checks if we have an odd numbered topology (true case: 4, 2, 4. false case: 4, 3, 3, 4)
  • checks if input size is equal to output size

json namespace not recognized

Within main.cpp, auto configJson = json::parse(str); shows error:
E0304: no instance of overloaded function "nlohmann::basic_json<ObjectType, ArrayType, BooleanType....
matches the argument list"

cannot train

Hi, I follow your instruction building with CMake. However, I cannot train. I ended up with
/home/leanne/Dev/projects/ann/cmake-build-debug/train
Syntax:
train [configFile]

Process finished with exit code 255
I use CLion. I tried again over teminal, the result is same and I got
Syntax:
train [configFile]
as the final output.

What did I miss? Everything built fine.

wy aren't you calling delete? (ever)

Yep noticed that too. Might roll out a new version with different architecture. Got the concepts down first. Thanks. (I think the latest push has the delete stuff but it's largely messy). Thanks

Problem when creating layers with more neurons than the previous layer.

Vector range problem.

Despite the fix you implemented(watched your video too!), the bug still persists.
The problem was that the matrix deltaWeights in Backpropagation() did not have the right dimensions to be looped over in:

for(int r = 0; r < tempNewWeights->getNumRows(); r++) {
for(int c = 0; c < tempNewWeights->getNumCols(); c++) {
double originalValue = this->weightMatrices.at(i - 1)->getValue(r, c);
double deltaValue = deltaWeights->getValue(r, c);

            originalValue = this->momentum * originalValue;
            deltaValue    = this->learningRate * deltaValue;
            
            tempNewWeights->setValue(r, c, (originalValue - deltaValue));
        }

}

(I couldn't get 'insert code' to work, sorry about the plain text)

The bug arises whenever deltaWeights matrix was of smaller dimensions than the tempNewWeights matrix.

The solution was to resize the deltaWeight Matrix to the same size of tempNewWeights before entering the nested loops above.

I've added a function to the Matrix source files that returns a resized array and hence the fixed code loop looks like:

Matrix* resizedDeltaWeights = deltaWeights->resize(
tempNewWeights->getNumRows(),
tempNewWeights->getNumCols()
);

for(int r = 0; r < tempNewWeights->getNumRows(); r++) {
for(int c = 0; c < tempNewWeights->getNumCols(); c++) {
double originalValue = this->weightMatrices.at(i - 1)->getValue(r, c);
double deltaValue = resizedDeltaWeights->getValue(r, c);

            originalValue = this->momentum * originalValue;
            deltaValue    = this->learningRate * deltaValue;
            
            tempNewWeights->setValue(r, c, (originalValue - deltaValue));
        }

}

And the implementation of resize is:

Matrix *Matrix::resize(unsigned long newRows, unsigned long newCols) {
Matrix *m = new Matrix(newRows, newCols, false);

unsigned long j = 0;

for(unsigned long i = 0; i < newRows; i++) {
    
    //if we've reached the boundry rows of the original mat, no left to copy.
    if (i > this->getNumRows() - 1) {
        m->setValue(i, j, 0);
    }else{
        for(unsigned long j = 0;j < newCols - 1; j++) {
            //if we've reached the boundry cols of the original mat, Set values beyond to zero.
            if (j >= this->getNumCols()) {
                m->setValue(i, j, 0);
            }else{
                m->setValue(i, j, this->getValue(i, j));
            }

        }
       
    }
    
}

return m;

}
Of course, delete resizedDeltaWeights later on.
Currently testing this implementation and it works well so far.

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.