Comments (3)
^ for a similar set up I have the same issue 👍
from convnetjs.
Hello,
I'm back with more questions.
I've implemented the Average Cross-Entropy/Log Loss Error Function for my ideal and prediction values.
- When running more than one hidden layer, all my network values propagate
Nan
. Is this intended behavior, loss of precision, or a bug? - When using only one hidden layer, I get convergence on absolute values e.g.,
[1, 0]
or[0, 1]
but my ACE becomes aNaN
.
My implementation is quite simple:
function log_error(actual, ideal)
{
var err_0 = ideal.w[0] * Math.log(actual.w[0]) + ((1 - ideal.w[0]) * Math.log(1 - actual.w[0]));
var err_1 = ideal.w[1] * Math.log(actual.w[1]) + ((1 - ideal.w[1]) * Math.log(1 - actual.w[1]));
return err_0 + err_1;
}
Please note that both ideal
and actual
are convnetjs.Vol
, and I obtain them during training iteration:
var log_sum = 0;
for (var k = 0; k < data.length; k++)
{
trainer.train(data[k][0], data[k][1]);
var actual = network.forward(data[k][0]);
log_sum += log_error(actual, data[k][1]);
}
var ace = -1*(log_sum / data.length);
The variable data
is an array which holds a convnetjs.Vol
as input data[k][0]
and a convnetjs.Vol
as output data[k][1]
which have been empirically verified.
I understand that the parameters learning_rate
play a very important role (I've experimented with very small and large values) as well as the L1 and L2 decay values are important.
I haven't yet cross-validated accuracy, but why do I keep seeing those NaN
values?
from convnetjs.
yeah, I am also having NaN issues for a 2-hidden-layer network running deep q learning. Everything is OK for a while and then suddenly I find all my network weights have turned to NaNs.
from convnetjs.
Related Issues (20)
- how to get the output from data
- After training, How to test on my test set??
- Deepqlearn to / from json not working
- is this a word mistake?
- How to predict average?
- How to use ConvnetJs with 64x128 image demension
- Type definitions
- I can't use ConvLayers in deepqlearn.js HOT 1
- [Question] <Sorry posted this in the wrong project>
- Reinforcement Learning basic sample not working HOT 2
- Seemingly Random Predictions HOT 2
- average_loss_window has a value of NaN HOT 6
- A 4x faster alternative to ConvNetJS HOT 6
- BatchNorm layer
- Convolutional Network not training HOT 2
- [Suggestion for "Painting"] Use of Fourier Features? HOT 3
- A better alternative to convnetjs HOT 3
- using own input images HOT 1
- How to feed labels into classifier network HOT 1
- pix2pix or CycleGAN
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from convnetjs.