Package ca.nengo.model.nef.impl

Examples of ca.nengo.model.nef.impl.DecodedTermination


    network.addNode(post);
    post.addDecodedTermination("input", MU.I(2), .01f, false);
    Projection p = network.addProjection(pre.getOrigin(NEFEnsemble.X), post.getTermination("input"));

    DecodedOrigin o = (DecodedOrigin) pre.getOrigin(NEFEnsemble.X);
    DecodedTermination t = (DecodedTermination) post.getTermination("input");
    float[][] directWeights = MU.prod(post.getEncoders(), MU.prod(t.getTransform(), MU.transpose(o.getDecoders())));
    System.out.println("Direct weights: " + MU.min(directWeights) + " to " + MU.max(directWeights));

    Probe probe = network.getSimulator().addProbe(post.getName(), NEFEnsemble.X, true);
    network.setMode(SimulationMode.CONSTANT_RATE);
    network.run(-1.5f, 1);
View Full Code Here


    if ( !(myOrigin instanceof DecodedOrigin) || !(myTermination instanceof DecodedTermination)) {
      throw new RuntimeException("This feature is only implemented for projections from DecodedOrigins to DecodedTerminations");
    }

    DecodedOrigin baseOrigin = (DecodedOrigin) myOrigin;
    DecodedTermination baseTermination = (DecodedTermination) myTermination;
    NEFEnsemble pre = (NEFEnsemble) baseOrigin.getNode();
    NEFEnsemble post = (NEFEnsemble) baseTermination.getNode();

    myBiasOrigin = pre.addBiasOrigin(baseOrigin, numInterneurons, getUniqueNodeName(post.getName() + "_" + baseTermination.getName()), excitatory);
    myInterneurons = myBiasOrigin.getInterneurons();
    myNetwork.addNode(myInterneurons);
    BiasTermination[] bt = post.addBiasTerminations(baseTermination, tauBias, myBiasOrigin.getDecoders(), baseOrigin.getDecoders());
    myDirectBT = bt[0];
    myIndirectBT = bt[1];
    if (!excitatory) {
            myIndirectBT.setStaticBias(new float[]{-1});
        }
    float[][] tf = new float[][]{new float[]{0, 1/tauInterneurons/tauInterneurons}, new float[]{2/tauInterneurons, 1/tauInterneurons/tauInterneurons}};
    myInterneuronTermination = (DecodedTermination) myInterneurons.addDecodedTermination("bias", MU.I(1), tf[0], tf[1], 0, false);

    myNetwork.addProjection(myBiasOrigin, myDirectBT);
    myNetwork.addProjection(myBiasOrigin, myInterneuronTermination);
    myNetwork.addProjection(myInterneurons.getOrigin(NEFEnsemble.X), myIndirectBT);

    if (optimize) {
      float[][] baseWeights = MU.prod(post.getEncoders(), MU.prod(baseTermination.getTransform(), MU.transpose(baseOrigin.getDecoders())));
      myBiasOrigin.optimizeDecoders(baseWeights, myDirectBT.getBiasEncoders(), excitatory);
      myBiasOrigin.optimizeInterneuronDomain(myInterneuronTermination, myIndirectBT);
    }

    myBiasIsEnabled = true;
View Full Code Here

   * @see ca.nengo.model.Projection#removeBias()
   */
  public void removeBias() {
    try {
      DecodedOrigin baseOrigin = (DecodedOrigin) myOrigin;
      DecodedTermination baseTermination = (DecodedTermination) myTermination;
      NEFEnsemble pre = (NEFEnsemble) baseOrigin.getNode();
      NEFEnsemble post = (NEFEnsemble) baseTermination.getNode();

      myNetwork.removeProjection(myDirectBT);
      myNetwork.removeProjection(myIndirectBT);
      myNetwork.removeProjection(myInterneuronTermination);
      myNetwork.removeNode(myInterneurons.getName());
View Full Code Here

      {
        terminationNodeFullName.append(tempTermination.getNode().getName() + ".");
        tempTermination = ((TerminationWrapper) tempTermination).getWrappedTermination();
      }
     
      DecodedTermination dTermination;
      StringBuilder transformString = new StringBuilder();
     
      transformString.append('[');
      if(tempTermination instanceof DecodedTermination)
      {
View Full Code Here

                    Origin origin = this.getOrigin(pet.getOriginName());
                    pet.setOriginState(origin.getName(), origin.getValues(), endTime);
                    pet.setTerminationState(endTime);

                    if (pet instanceof ModulatedPlasticEnsembleTermination) {
                        DecodedTermination modTerm = (DecodedTermination)
                            this.getTermination(((ModulatedPlasticEnsembleTermination) pet).getModTermName());

                        InstantaneousOutput input = new RealOutputImpl(modTerm.getOutput(), Units.UNK, endTime);
                        ((ModulatedPlasticEnsembleTermination) pet).setModTerminationState
                          (modTerm.getName(), input, endTime);
                    }
                }
                catch (StructuralException e) {
                    throw new SimulationException(e.getMessage());
                }
View Full Code Here

TOP

Related Classes of ca.nengo.model.nef.impl.DecodedTermination

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.