public void trainLive(Sample s)
	{
	//	lc*=0.9999f;
		//clear the network
		this.prepare();
		//do a run through with the current values
		process(s);
		
		//make an array of output errors
		
		float[] outputErrors = new float[s.outs.size()];
		
		
		//calculate output errors
		for(int i =0; i <outputErrors.length; i++)
		{
			float o = outputNeurons.get(i).getOutput();
			outputErrors[i] = o*(1.0f-o)*(s.outs.get(i) - o);
		} 
		
		//change output layer weights
		//get weights from hidden to output layer
		
		for(Neuron n : hiddenNeurons)
		{
			/*
			 * this counts which of the destination neurons we are dealing with 
			 * in this cycle so we can access the error from the errors vector
			 */
			int count = 0;
			for(Connection c : n.connections)
			{
				c.weight = c.weight + lc*outputErrors[count]*n.output;
				count++;
			}
		}
		
		/**
		 * Propagate hidden layer errors. This means another vector of errors, one for each hidden neuron.
		 */
		
		float[] hiddenErrors = new float[hiddenNeurons.size()];
		
		//calculate output errors
			for(int i =0; i <hiddenErrors.length; i++)
			{
				float o = hiddenNeurons.get(i).getOutput();
				
				//do the error summation
				float sum = 0;
				int count = 0;
				for(Connection c : hiddenNeurons.get(i).connections)
				{
					sum+=outputErrors[count]*c.weight;
					count++;
				}
				
				hiddenErrors[i] = o*(1.0f-o) * sum;
			}
			
		/**
		 * Change hidden layer weights.
		 */
		
			//get weights from input to hidden layer
			
			for(Neuron n : inputNeurons)
			{
				/*
				 * this counts which of the destination neurons we are dealing with 
				 * in this cycle so we can access the error from the errors vector
				 */
				int count = 0;
				for(Connection c : n.connections)
				{
					//remember that the input layer outputs don't go through a sigmoid, so they are the same as the inputs
					c.weight = c.weight + lc*hiddenErrors[count]*n.output;
					count++;
				}
			}
			
			//the network is now trained!
			
			
	}