Git Product home page Git Product logo

gophernet's Introduction

Building a Neural Net From Scratch with Go

This is a simple neural network built in Go. It is further discussed here and in Machine Learning with Go.

gophernet's People

Contributors

appleboy avatar ctava avatar dwhitena avatar jezek avatar sbinet 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

gophernet's Issues

Calculating slope using sigmoid prime in training

Hello. I've been digging around neural networks lately. I made me a single hidden layer network from scratch and was not sure, if my results are right and I made a mistake. So I tried to find another implementations to compare results and I stumbled upon this repo & blog. So I made result comparison between your and my implementation and the results didn't match for the same initial conditions.

After some time spent to reevaluate my code, some other examples and math background, I've decided to write tis issue to ask a question about your training code on following lines.

gophernet/main.go

Lines 174 to 176 in 09031b1

slopeOutputLayer.Apply(applySigmoidPrime, output)
slopeHiddenLayer := new(mat.Dense)
slopeHiddenLayer.Apply(applySigmoidPrime, hiddenLayerActivations)

My question is: Is there a bug in your code? Shouldn't the parameter to applySigmoidPrime be outputLayerInput (resp. hiddenLayerInput)?

I've found some materials and there they compute the delta using sigmoid prime (derivation of sigmoid) with the same input as the parameter to sigmoid in input forward propagaion.

NOTE: Or since the output = sigmoid(outputLayerInput), you can compute the sigmoidPrime as output*(1-output).

Thank you for your time & I'm looking forward to your answer.

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.