Git Product home page Git Product logo

Comments (3)

inferrna avatar inferrna commented on May 18, 2024 1

What is the desired value in the dataset?

I try to predict float value by its cosine and sine. More precisely, input is [(sin(y)+1.0)/2.0, (cos(y)+1.0)/2.0]

I changed (also in gist)

let z = g.matmul(xww2, w3) + b;

to

let z = g.sigmoid(g.matmul(xww2, w3) + b);

and

let mean_loss = g.reduce_mean(g.sigmoid_cross_entropy(z, &y), &[0,1], false);

to

let mean_loss = g.reduce_mean(g.square(g.sub(z, &y)), &[0,1], false);

Now error is near 0.03 which is much better (but still not perfect). Thank you for help.
(Although, it would be very nice to have example for such cases with MSE loss function and a lot of layers and etc - for those ones who migrating from fann)

from rust-autograd.

raskr avatar raskr commented on May 18, 2024

I'm sorry I can't figure out the reason why that is, but

let values = z.eval(&[x.given(x_test.view()), y.given(y_test.view())]).unwrap();

should be like below because z is not normalized to be between 0~1.

let values = g.sigmoid(z).eval(&[x.given(x_test.view()), y.given(y_test.view())]).unwrap();

stuck on error ~ 0.585, which is very large for task detecting value from 0.0 to 1.0.

In your code, acc seems to be (binary) cross entropy. What is the desired value in the dataset?

from rust-autograd.

raskr avatar raskr commented on May 18, 2024

Although, it would be very nice to have example for such cases with MSE loss function and a lot of layers and etc - for those ones who migrating from fann)

Sorry about the poor example code.
I know that the num of use cases is important for this kind of tools, but I don't have enough time to do it...

from rust-autograd.

Related Issues (20)

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.