1 package yawn.nn; 2 3 import yawn.util.Pattern; 4 5 /*** 6 * An input (more or less dummy) layer. 7 * 8 * <p>$Id: InputLayer.java,v 1.5 2005/05/09 11:04:58 supermarti Exp $</p> 9 * 10 * @author Luis Martí (luis dot marti at uc3m dot es) 11 * @version $Revision: 1.5 $ 12 */ 13 14 public class InputLayer extends Layer { 15 16 /*** 17 * 18 * @uml.property name="input" 19 * @uml.associationEnd multiplicity="(0 1)" 20 */ 21 protected Pattern input; 22 23 24 protected InputLayer() { 25 super(); 26 input = null; 27 } 28 29 public InputLayer(Layer nextLayer, int inputSize) { 30 super(nextLayer, inputSize); 31 input = new Pattern(inputSize); 32 } 33 34 public void setInput(Pattern p) { 35 input.setComponents(p); 36 } 37 38 /*** 39 * 40 * @uml.property name="input" 41 */ 42 protected Pattern getActivations() { 43 return input; 44 } 45 46 public void propagateToNode(int index) { 47 NeuralNode[] nodes = nextLayer.getNodes(); 48 nodes[index].setInput(input); 49 } 50 51 }