use of com.simiacryptus.util.FastRandom in project MindsEye by SimiaCryptus.
the class StochasticBinaryNoiseLayer method eval.
@Override
public Result eval(@Nonnull final Result... inObj) {
assert null == inObj || 0 == inObj.length;
Tensor mask = masks.computeIfAbsent(seed, s -> {
Tensor m = new Tensor(dimensions);
FastRandom random = new FastRandom(seed ^ layerSeed);
for (int i = 0; i < m.length(); i++) {
m.set(i, s == 0 || (random.random() < density) ? amplitude : 0);
}
m.detach();
return m;
});
return new Result(TensorArray.create(mask), null);
}
Aggregations