$ cmake .
$ make
$ ./train [path/to/config.json]
$ ./autoencode_classify [path/to/config.json]
Artificial Neural Networks implemented in C++
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"
Given set of weights and datapoint, classify entity based on error rate
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.
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
[625, 50, 625] works but [625, 1000, 50, 625] doesn't
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.
In Neuron.cpp line 12 I don't understand why it's activatedVal == RELU
and not activationType
. Same question on line 18
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.