/** * Call this to get the error value of this unit. * @param calculate True if the value should be calculated if it hasn't been * already. * @return The error value, or NaN, if the value has not been calculated. */ public double errorValue(boolean calculate) { if (!Double.isNaN(m_unitValue) && Double.isNaN(m_unitError) && calculate) { //then calculate the error. m_unitError = m_methods.errorValue(this); } return m_unitError; }
/** * Call this to get the output value of this unit. * @param calculate True if the value should be calculated if it hasn't been * already. * @return The output value, or NaN, if the value has not been calculated. */ public double outputValue(boolean calculate) { if (Double.isNaN(m_unitValue) && calculate) { //then calculate the output value; m_unitValue = m_methods.outputValue(this); } return m_unitValue; }
/** * Call this function to update the weight values at this unit. * After the weights have been updated at this unit, All the * input connections will then be called from this to have their * weights updated. * @param l The learning rate to use. * @param m The momentum to use. */ public void updateWeights(double l, double m) { if (!m_weightsUpdated && !Double.isNaN(m_unitError)) { m_methods.updateWeights(this, l, m); //note that the super call to update the inputs is done here and //not in the m_method updateWeights, because it is not deemed to be //required to update the weights at this node (while the error and output //value ao need to be recursively calculated) super.updateWeights(l, m); //to call all of the inputs. } }
/** * Call this function to update the weight values at this unit. * After the weights have been updated at this unit, All the * input connections will then be called from this to have their * weights updated. * @param l The learning rate to use. * @param m The momentum to use. */ public void updateWeights(double l, double m) { if (!m_weightsUpdated && !Double.isNaN(m_unitError)) { m_methods.updateWeights(this, l, m); //note that the super call to update the inputs is done here and //not in the m_method updateWeights, because it is not deemed to be //required to update the weights at this node (while the error and output //value ao need to be recursively calculated) super.updateWeights(l, m); //to call all of the inputs. } }
/** * Call this to get the output value of this unit. * @param calculate True if the value should be calculated if it hasn't been * already. * @return The output value, or NaN, if the value has not been calculated. */ public double outputValue(boolean calculate) { if (Double.isNaN(m_unitValue) && calculate) { //then calculate the output value; m_unitValue = m_methods.outputValue(this); } return m_unitValue; }
/** * Call this to get the error value of this unit. * @param calculate True if the value should be calculated if it hasn't been * already. * @return The error value, or NaN, if the value has not been calculated. */ public double errorValue(boolean calculate) { if (!Double.isNaN(m_unitValue) && Double.isNaN(m_unitError) && calculate) { //then calculate the error. m_unitError = m_methods.errorValue(this); } return m_unitError; }