Search in sources :

Example 1 with TensorFunc

use of jcog.math.tensor.TensorFunc in project narchy by automenta.

the class TensorRL1 method noiseChip.

static void noiseChip(PhyWall p) {
    {
        final Random rng = new XoRoShiRo128PlusRandom(1);
        final TensorFunc randomVector = Tensor.randomVectorGauss(16, 0, 1, rng);
        final FloatRange lerpRate = new FloatRange(0.01f, 0, 1f);
        final TensorLERP lerpVector = new TensorLERP(randomVector, lerpRate);
        p.put(new Gridding(0.25f, // ),
        new LabeledPane("rng", new AutoUpdateMatrixView(lerpVector.data)), new LabeledPane("lerp", new XYSlider().on((x, y) -> {
            lerpRate.set(x);
        })), new LabeledPane("out", new Port() {

            @Override
            public void prePaint(int dtMS) {
                super.prePaint(dtMS);
                lerpVector.update();
                out(lerpVector.data);
            }
        })), 0.5f, 0.5f);
    }
}
Also used : Gridding(spacegraph.space2d.container.Gridding) XoRoShiRo128PlusRandom(jcog.math.random.XoRoShiRo128PlusRandom) Random(java.util.Random) XoRoShiRo128PlusRandom(jcog.math.random.XoRoShiRo128PlusRandom) TensorFunc(jcog.math.tensor.TensorFunc) AutoUpdateMatrixView(spacegraph.space2d.widget.meter.AutoUpdateMatrixView) XYSlider(spacegraph.space2d.widget.slider.XYSlider) FloatRange(jcog.math.FloatRange) Port(spacegraph.space2d.widget.windo.Port) LabeledPane(spacegraph.space2d.widget.text.LabeledPane) TensorLERP(jcog.math.tensor.TensorLERP)

Aggregations

Random (java.util.Random)1 FloatRange (jcog.math.FloatRange)1 XoRoShiRo128PlusRandom (jcog.math.random.XoRoShiRo128PlusRandom)1 TensorFunc (jcog.math.tensor.TensorFunc)1 TensorLERP (jcog.math.tensor.TensorLERP)1 Gridding (spacegraph.space2d.container.Gridding)1 AutoUpdateMatrixView (spacegraph.space2d.widget.meter.AutoUpdateMatrixView)1 XYSlider (spacegraph.space2d.widget.slider.XYSlider)1 LabeledPane (spacegraph.space2d.widget.text.LabeledPane)1 Port (spacegraph.space2d.widget.windo.Port)1