Design

BasicFeedForwardNeuralNetwork Class

The neural network is implemented in the BasicFeedForwardNeuralNetwork class inherited from my SimpleML project. The network trains using gradient descent with backpropagation, and implements a simple learning rate for regularization. It also provides methods InitialiseWeights(), to set the weights of the network to small random values, and Predict() to find a result based on a specified set of input values and the current weights.

ASP.NET Web API

BackPropagationVisualization is run/hosted within an ASP.NET Web API application, which provides a clear separation between the business logic and data (implemented in C# and served up via REST methods), and presentation and model/view/whatever (handled by AngularJS). It's not a true web application, as the data layer holds only a single neural network which maintains state (i.e. the weights and activation values). Multiple users of the UI would be accessing the same instance of the BasicFeedForwardNeuralNetwork class and overwrite each others training data. AngularJS was chosen to provide a functional and slick interface for a single user, but not to provide the multi-user capability of a true web application.

UI/Frontend

AngularJS is used to provide a single page web application interface to BackPropagationVisualization. The UI code follows the general design directions set out in the AngularJS documentation, i.e...

  • index.html defines the page layout, calls methods on the controller mainController to implement functions in the network, and shares data with mainController via the $scope object.
  • mainController defines an interface for the business logic required by index.html, basically proxying data and method calls between index.html and the neuralNetworkDataInterfaceService. It also catches and displays any errors returned by neuralNetworkDataInterfaceService, and displays a wait dialog during any long running service calls.
  • neuralNetworkDataInterfaceService exposes methods that proxy REST calls to the C# code hosting the neural network. It uses the AngularJS $http service to call the .NET REST methods and then executes different callback functions depending on the success of the $http call.

Layer Interaction

(coming soon...)