@@ -0,0 +1,1425 @@
+package autodiff.learning;%0A%0Aimport java.io.Serializable;%0Aimport java.util.BitSet;%0Aimport java.util.Collections;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Aimport autodiff.computing.DefaultProcessor;%0Aimport autodiff.computing.NodeProcessor;%0Aimport autodiff.nodes.Node;%0A%0A/**%0A * @author codistmonk (creation 2016-07-14)%0A */%0Apublic abstract interface Minimizer extends Runnable, Serializable %7B%0A%09%0A%09public default NodeProcessor getProcessor() %7B%0A%09%09return DefaultProcessor.INSTANCE;%0A%09%7D%0A%09%0A%09public default Map%3CNode%3C?%3E, BitSet%3E getParameterLocks() %7B%0A%09%09return Collections.emptyMap();%0A%09%7D%0A%09%0A%09public abstract List%3CNode%3C?%3E%3E getParameters();%0A%09%0A%09public abstract Node%3C?%3E getCost();%0A%09%0A%09public default void updateParameters() %7B%0A%09%09// NOP%0A%09%7D%0A%09%0A%09@Override%0A%09public default void run() %7B%0A%09%09float bestCost = updateCost(Float.POSITIVE_INFINITY);%0A%09%09%0A%09%09while (!this.isDone()) %7B%0A%09%09%09this.updateParameters();%0A%09%09%09%0A%09%09%09bestCost = updateCost(bestCost);%0A%09%09%7D%0A%09%09%0A%09%09this.restoreBestParameters();%0A%09%7D%0A%09%0A%09public default float updateCost(final float previousBestCost) %7B%0A%09%09this.getProcessor().fullForward(this.getCost());%0A%09%09%0A%09%09final float cost = this.getCost().get();%0A%09%09%0A%09%09if (cost %3C previousBestCost) %7B%0A%09%09%09this.saveBestParameters();%0A%09%09%09%0A%09%09%09return cost;%0A%09%09%7D%0A%09%09%0A%09%09return previousBestCost;%0A%09%7D%0A%09%0A%09public default boolean isDone() %7B%0A%09%09return true;%0A%09%7D%0A%09%0A%09public default void saveBestParameters() %7B%0A%09%09// NOP%0A%09%7D%0A%09%0A%09public default void restoreBestParameters() %7B%0A%09%09// NOP%0A%09%7D%0A%09%0A%7D%0A

Add interface Minimizer.