Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Neuron {
- private double value;
- private double error;
- /**
- * Links to neurons in next layer
- */
- public ArrayList<Link> forward;
- /**
- * Links to neurons in previous layer
- */
- public ArrayList<Link> backward;
- /**
- * Constructor
- */
- public Neuron() {
- forward = new ArrayList<>();
- backward = new ArrayList<>();
- }
- public double getValue() { return value; }
- public void setValue(double v) { value = v; }
- public double getError() { return error; }
- public void setError(double e) { error = e; }
- }
- public class Link {
- static Random r = new Random();
- public Link() {
- weight = r.nextDouble();
- }
- public double weight;
- public Neuron prev, next;
- }
Advertisement
Add Comment
Please, Sign In to add comment