/PSONet

An implementation of Policy Swarm Optimization of the problem of finding weights & biases for a neural net

Primary LanguageC

PSONet

This an implementation of Particle Swarm Optimization (PSO) to the (optimization) problem of discovering the weights & biases of a (fully connected) neural net.

The neural net is implemented from scratch in pure numpy. It also includes an implementation of backpropagation (the backward pass is unrolled by hand, so some work is required in order to add more layers).

The net is used to solve the XOR problem.

The PSO implementation was adapted from Machine Learning Mastery.

The net is implemented as using row-major linear algebra: net inputs are row vectors (or, for batched inputs, 2D matrices where each row is a feature vector, and one batch is a column vector or row vectors), weight matrices right-multiply input row vectors (or input matrices, for batched inputs).

dependencies

pip3 install numpy