public void applyTruncation(StringKeyedVector instance) {
final double update = this.optimizer.getDecreasingLearningRate(epoch) * truncationUpdate;
final double threshold = truncationThreshold;
TDoubleFunction truncFn = new TDoubleFunction() {
public double execute(double parameter) {
if (parameter > 0 && parameter < threshold) {
return Math.max(0, parameter - update);
} else if (parameter < 0 && parameter > -threshold) {
return Math.min(0, parameter + update);