Code Monkey home page Code Monkey logo

neural-network's Introduction

About

The Tremani Neural Network allows you to build, train and employ neural networks in PHP. It is easy to use and set up, and does not rely on external software to be installed on your webserver. The software is open source under the BSD license, which means you can use and modify it freely.

About neural networks

A neural network can be used to find complex relationships between data. Usually, you start with a large set of data that has some unknown relationship between input and output. A neural network can be used to find that unknown relationship. Once that relationship is found, the neural network can be used to compute the output for similar (but usually different) input. So, essentially, neural networks can learn complex relationships between input and output.

For example, neural networks can learn the XOR-function, it can be used to estimate the difficulty of a text or be trained in pattern recognition.

Previously advanced

This software implements the 2007 state-of-the-art technology in neural networks. There has been immense progress in this field since that time though, but this software is still useful as an introduction to neural networks or if you need something fairly simple. The network that is created is a feed forward, multi-layer perceptron network with support for momentum learning and an advanced mechanism to prevent overfitting. Also, it allows you to easily adapt it to your needs by overriding key methods such as the activation function.

History

This software was originally built in early 2007 for one of the projects we did at Tremani, a most excellent web design & web development agency based in charmingly beautiful Delft, the Netherlands.

The goal of this project was to allow a user to determine the ‘language reference level’ (i.e. the 'difficulty') of any given text. Basically, it will tell you if a given text is difficult to read or easy to understand, by looking at the complexity of the used language.

To determine this language reference level, we first did a statistical analysis of the text. Then, the resulting characteristics of the text are fed to a neural network. This neural network then applies the knowledge it has obtained in an earlier phase to determine the text’s difficulty.

We chose to build this system with a neural network because no comprehensive knowledge exists on the relationship between our input characteristics and the corresponding output. The relationship does exist, but is hard to find – and even harder to describe in software. However, a neural network can find and describe such a relationship quite easily.

Existing neural networks available for PHP at the time (most notably FANN) were difficult to set up, so we built one ourselves.

Documentation

There is some API level documentation available in the 'documentation.html' file, or just have a look at the provided example code.

Good luck! If you ever build something nice with this, please let me know.

neural-network's People

Contributors

exibi avatar infostreams avatar rik43 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neural-network's Issues

Reset Weights...

Why $n->initWeights();
Every Epoch reset weights ??? Why ??
Reset weights cause Network initialize from new.

And loss previous worked !!

After load

I am not sure understanding the load portion, after saving and loading how to compute? Also how to get output of test data then?

derivativeActivation($value)

protected function activation($value) {
    return tanh($value);
    // return (1.0 / (1.0 + exp(- $value)));
}
protected function derivativeActivation($value) {
    $tanh = tanh($value);
    return 1.0 - $tanh * $tanh;
    //return $value * (1.0 - $value);
}

I don't get it. Either
derivativeActivation should return 1.0 - $value * $value;
or the comment below for sigmoid should read
//return activation($value) * (1.0 - activation($value));

input and output

I can't understand if the input values must be between 0 and 1 or between -1 and +1 or... ? can you help me?

XOR Problem

I am not sure if this is an issue or not but..

The following code:
$n->addTestData(array (-1, -1, 1), array (-1));
$n->addTestData(array (-1, 1, 1), array ( 1));
$n->addTestData(array ( 1, -1, 1), array ( 1));
$n->addTestData(array ( 1, 1, 1), array (-1));

Should this not be:
$n->addTestData(array (-1, -1, 0), array (-1));
$n->addTestData(array (-1, 1, 1), array ( 1));
$n->addTestData(array ( 1, -1, 1), array ( 1));
$n->addTestData(array ( 1, 1, 0), array (-1));

If not, what is the purpose of the third variable here if not the classification? If this third variable is not the classification (expected result) then how do you train this NN?

Thanks.

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.