A Neural Network implemented from scratch
Fix backpropagation Re-add bias Tests Add a wiki
A Neural Network implemented from scratch
My old implementation of bias proved to be a nightmare when trying to implement backpropagation. This is partly because of what is described in #8.
Time for attempt number 2 at biases.
We can discuss here different ways to design the model of the network itself. For example, should a layer
be represented as an object, or merely a list of lists of neurons?
Right now, the Network
object holds the layers as a List
of tuples, where each tuple looks like this: (W, [n_0, n_1, ..., n_k])
, where k
is the number of neurons in the layer and W
is the weight matrix for the layer.
The main problem at the moment is where to store the weights. The model described above it frustrating because individual neurons need three things to compute its output:
k
k
, which we will call j
hereW_kj
I am firmly against the idea of storing the weight matrix in every neuron, which means that a neuron must be able to ask its parent for the appropriate value from the weight matrix when it's computing. Any other ideas?
One way of doing this is to have a member variable inside the neuron for its own index k
, its layers index in the overall network, and a network_shape
variable which describes the size of each layer - i.e. [6, 3, 3]
. The Neuron
also has a reference to the Network
, allowing it to ask the Network
for the appropriate W_ij
.
I'll update this as I think of other ideas.
It's about time...
Backprop isn't implemented fully correctly at the moment.
I should mathematically deduce the expectations of each layer in terms of input and output shapes. Each layer should automatically know the exact shape of all the matrices and vectors associated with it.
I spotted an implementation of activation functions as layers here. It might simplify the gradient juggling during backpropagation - each layer performs one gradient multiply and passes it on/updates.
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.