private void createNetwork(int[] layers){
		//Network must have at least one layer
		assert(layers != null && layers.length != 0);
		input_nodes = layers[0];
		
		//Create nodes for each layer
		for (int i=0, count; i<layers.length; i++){
			count = layers[i];
			//Layers must have positive node count
			assert(count > 0);
			boolean hidden = i != layers.length-1;
			//Create the actual nodes
			Node[] layer = new Node[count+(hidden ? 1 : 0)];
			for (int j=0; j<count; j++)
				layer[j] = new Node(false);
			//Extra node for bias
			if (hidden)
				layer[count] = new Node(true);
			this.layers.add(layer);
		}
		
		//Create links
		for (int i=0; i<layers.length-1; i++){
			Node[] prev = this.layers.get(i),
					next = this.layers.get(i+1);
			for (Node n: next){
				for (Node p: prev)
					p.addOutlink(n);
			}
		}
	}