Package ca.nengo.math.impl

Examples of ca.nengo.math.impl.IndicatorPDF


  public static void main(String[] args) {
        try {
            JavaSourceParser.addSource(new File("src/java/main"));

            final Object configurable = NoiseFactory.makeRandomNoise(1, new IndicatorPDF(0, 1));
            final JFrame frame = new JFrame("Tree Test");

            JButton button = new JButton("configure");
            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
View Full Code Here


            //x, .3: varying x keeps time constant, changes adapted rate
//          ALIFSpikeGenerator generator = new ALIFSpikeGenerator(.002f, .02f, .5f, .01f);  //.2: .01 to .3 (150 to 20ms)
//          SynapticIntegrator integrator = new LinearSynapticIntegrator(.001f, Units.ACU);
//          PlasticExpandableSpikingNeuron neuron = new PlasticExpandableSpikingNeuron(integrator, generator, 15f, 0f, "alif");

            ALIFNeuronFactory factory = new ALIFNeuronFactory(new IndicatorPDF(200, 400), new IndicatorPDF(-2.5f, -1.5f),
                    new IndicatorPDF(.1f, .1001f), .0005f, .02f, .2f);

//          VectorGenerator vg = new RandomHypersphereVG(false, 1, 0);
//          ApproximatorFactory factory = new WeightedCostApproximator.Factory(.1f);
//          NEFEnsemble ensemble = new NEFEnsembleImpl("ensemble", new NEFNode[]{neuron}, new float[][]{new float[]{1}}, factory, vg.genVectors(100, 1));
View Full Code Here

  /*
   * Test method for 'ca.nengo.math.impl.IndicatorPDF.sample()'
   */
  public void testSample() {
    PDF pdf = new IndicatorPDF(-1, 1);
   
    for (int i = 0; i < 10; i++) {
      float[] s = pdf.sample();
      assertEquals(1, s.length);
      assertTrue(s[0] > -1 && s[0] < 1);
    }
   
    pdf = new IndicatorPDF(0, 0);
    assertEquals(0f, pdf.sample()[0]);
  }
View Full Code Here

  /*
   * Test method for 'ca.nengo.math.impl.IndicatorPDF.getDimension()'
   */
  public void testGetDimension() {
    PDF pdf = new IndicatorPDF(-1, 1);
    assertEquals(1, pdf.getDimension());
  }
View Full Code Here

  /*
   * Test method for 'ca.nengo.math.impl.IndicatorPDF.map(float[])'
   */
  public void testMap() {
    PDF pdf = new IndicatorPDF(-1, 1);
    assertClose(0f, pdf.map(new float[]{-1.5f}));
    assertClose(.5f, pdf.map(new float[]{-0.5f}));
    assertClose(.5f, pdf.map(new float[]{0.5f}));
    assertClose(0f, pdf.map(new float[]{1.5f}));
   
    pdf = new IndicatorPDF(5, 5);
    assertEquals(Float.POSITIVE_INFINITY, pdf.map(new float[]{5}));
  }
View Full Code Here

  /*
   * Test method for 'ca.nengo.math.impl.IndicatorPDF.multiMap(float[][])'
   */
  public void testMultiMap() {
    PDF pdf = new IndicatorPDF(-1, 1);
    float[] result = pdf.multiMap(new float[][]{new float[]{0f}, new float[]{2f}});
   
    assertEquals(2, result.length);
    assertClose(.5f, result[0]);
    assertClose(0f, result[1]);
  }
View Full Code Here

        super(ensemble, name, nodeTerminations);
        setOriginName(Neuron.AXON);
       
        // If initial theta not passed in, randomly generate
        if (initialTheta == null) {
            IndicatorPDF uniform = new IndicatorPDF(0.00005f, 0.00015f);
            myInitialTheta = new float[nodeTerminations.length];
            for (int i = 0; i < myInitialTheta.length; i ++) {
                // Reasonable assumption: high gain, high theta
                myInitialTheta[i] = uniform.sample()[0] * myGain[i];
            }
        } else {
            myInitialTheta = initialTheta;
        }
        myTheta = myInitialTheta.clone();
View Full Code Here

     * @param dim Dimensions of the network
     * @param size Number of pyramidal neurons in the network
     * @throws StructuralException if name isn't unique
     */
    public PyramidalNetwork(String name, int dim, int size) throws StructuralException {
        this(name,dim,size,new IndicatorPDF(100,100));
    }
View Full Code Here

        //Originally a sigmoid function was given for the soma in the Poirazi et al. article as well.
        //This was not used due to the fact that it characterizes a rate response as opposed to spiking behaviour
        //Instead, a spiking LIFNeuron is used, until a spiking function can be found for pyramidal neurons
        //creates a standard node factory
        g = new LIFNeuronFactory();
        ((LIFNeuronFactory)g).setIntercept(new IndicatorPDF(-1,1));
        ((LIFNeuronFactory)g).setTauRC(0.02f);
        ((LIFNeuronFactory)g).setTauRef(0.002f);
        ((LIFNeuronFactory)g).setMaxRate(new IndicatorPDF(100,200));

        //if X is the origin the dendrites connect to the soma with, then this network is treated as a communication channel
        //thus the soma is given the same dimensions as the dendritic ensembles
        if (this.myConnectedOrigin.equals("X"))
        {
View Full Code Here

    /**
     * Set reasonable defaults
     */
    public LinearFactory() {
      myMaxRate = new IndicatorPDF(200, 400);
      myIntercept = new IndicatorPDF(-.9f, .9f);
      myRectified = true;
    }
View Full Code Here

TOP

Related Classes of ca.nengo.math.impl.IndicatorPDF

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.