use of jcog.math.random.XorShift128PlusRandom in project narchy by automenta.
the class HijackBagTest method testHijackSampling.
@Test
public void testHijackSampling() {
for (int cap : new int[] { 63, 37 }) {
int rep = 3;
int batch = 4;
int extraSpace = 5;
final Random rng = new XorShift128PlusRandom(1);
DefaultHijackBag bag = new DefaultHijackBag(plus, cap * extraSpace, rep) {
@Override
public void onRemove(Object value) {
fail("");
}
@Override
public void onReject(Object value) {
fail("");
}
};
fillLinear(bag, cap);
testBagSamplingDistribution(bag, batch);
bag.print();
}
}
use of jcog.math.random.XorShift128PlusRandom in project narchy by automenta.
the class LSTMView method main.
public static void main(String[] arg) {
Random r = new XorShift128PlusRandom(1234);
DistractedSequenceRecall task = new DistractedSequenceRecall(r, 32, 8, 8, 100);
int cell_blocks = 16;
SimpleLSTM lstm = task.lstm(cell_blocks);
float lr = 0.1f;
// initialize
task.scoreSupervised(lstm, lr);
SpaceGraph.window(new LSTMView(lstm), 800, 800);
int epochs = 5000;
for (int epoch = 0; epoch < epochs; epoch++) {
double fit = task.scoreSupervised(lstm, lr);
if (epoch % 10 == 0)
System.out.println("[" + epoch + "] error = " + (1 - fit));
Util.sleep(1);
}
System.out.println("done.");
}
Aggregations