Examples of Ensemble


Examples of ca.nengo.model.Ensemble

                UINeuron neuronUI = new UINeuron(neuron);

                addUINode(neuronUI, false, false);
              } else if (node instanceof Ensemble) {
                Ensemble ensemble = (Ensemble)node;
                UIEnsemble ensembleUI = new UIEnsemble(ensemble);
                addUINode(ensembleUI,false,false);
               
              } else if (node instanceof Network) {
                Network network = (Network)node;
View Full Code Here

Examples of ca.nengo.model.Ensemble

      getProbeParent().getNetworkParent().getSimulator().removeProbe(getModel());
      getProbeParent().showPopupMessage("Probe removed from Simulator");
     
      Probe model = getModel();
      if(model.isInEnsemble()){
        Ensemble target = (Ensemble) model.getTarget();
        target.stopProbing(model.getStateName());
      }
    } catch (SimulationException e) {
      UserMessages.showError("Could not remove probe: " + e.getMessage());
    }
View Full Code Here

Examples of ca.nengo.model.Ensemble

      result.myNode = node;
     
      // get origins for nodes in new ensemble
      Origin[] origins = new Origin[myNodeOrigins.length];
      if (node instanceof Ensemble) {
        Ensemble ensemble = (Ensemble)node;
        for (int i = 0; i < myNodeOrigins.length; i++)
          origins[i] = ensemble.getNodes()[i].getOrigin(myNodeOrigins[i].getName());
      }
      if (node instanceof Network) {
        Network network = (Network)node;
        for (int i = 0; i < myNodeOrigins.length; i++)
          origins[i] = network.getNodes()[i].getOrigin(myNodeOrigins[i].getName());
View Full Code Here

Examples of ca.nengo.model.Ensemble

    // get terminations for nodes in new ensemble
    result.myNodeTerminations = myNodeTerminations.clone();
    if (node instanceof Ensemble || node instanceof Network) {
      try {
        if (node instanceof Ensemble) {
          Ensemble ensemble = (Ensemble)node;
          for (int i = 0; i < result.myNodeTerminations.length; i++){
            result.myNodeTerminations[i] = ensemble.getNodes()[i].getTermination(myNodeTerminations[i].getName());
          }
        }
        if (node instanceof Network) {
          Network network = (Network)node;
          for (int i = 0; i < result.myNodeTerminations.length; i++){
View Full Code Here

Examples of ca.nengo.model.Ensemble

  /*
   * Test method for 'ca.bpt.cn.model.impl.NetworkImpl.getNodes()'
   */
  public void testGetNodes() throws StructuralException {
    Ensemble a = new MockEnsemble("a");
    myNetwork.addNode(a);
    myNetwork.addNode(new MockEnsemble("b"));

    assertEquals(2, myNetwork.getNodes().length);

View Full Code Here

Examples of ca.nengo.model.Ensemble

    return numDead;
  }
 
  public void testAddNode() throws StructuralException
  {
    Ensemble a = new MockEnsemble("a");
   
    try
    {
      myNetwork.getNode("a");
      fail("Node is present in network when it shouldn't be");
View Full Code Here

Examples of ca.nengo.model.Ensemble

   
  }
 
  public void testRemoveNode() throws StructuralException, SimulationException
  {
    Ensemble a = new MockEnsemble("a");
   
    myNetwork.addNode(a);
    if(myNetwork.getNode("a") == null)
      fail("Node not added");
   
View Full Code Here

Examples of ca.nengo.model.Ensemble

      Probeable target = oldProbe.getTarget();
      if (target instanceof Node) {
        Node oldNode = (Node) target;
        if (oldProbe.isInEnsemble()) {
          try {
            Ensemble oldEnsemble = (Ensemble) getNode(oldProbe.getEnsembleName());
            int neuronIndex = -1;
            for (int j = 0; j < oldEnsemble.getNodes().length && neuronIndex < 0; j++) {
              if (oldNode == oldEnsemble.getNodes()[j]) {
                                neuronIndex = j;
                            }
            }
            result.mySimulator.addProbe(oldProbe.getEnsembleName(), neuronIndex, oldProbe.getStateName(), true);
          } catch (SimulationException e) {
View Full Code Here

Examples of ca.nengo.model.Ensemble

        Node[] nodes = network.getNodes();

        boolean childCollecting = false;
        for (Node node : nodes) {
            if (node instanceof Ensemble) {
                Ensemble ensemble = (Ensemble) node;

                if (ensemble.isCollectingSpikes()) {
                    SortableMutableTreeNode ensNode = createSortableNode(top, ensemble);
                    /*
                     * Make a clone of the data
                     */
                    SpikePattern spikePattern = (SpikePattern) Util.cloneSerializable(ensemble.getSpikePattern());
                    DefaultMutableTreeNode spNode = new SpikePatternNode(spikePattern);
                    ensNode.add(spNode);

                    childCollecting = true;
                }
View Full Code Here

Examples of edu.uci.jforestsx.learning.trees.Ensemble

    curValidSet = validSet;
    validPredictions.setSample(curValidSet);
    validPredictions.reset();

    Ensemble ensemble = new Ensemble();
    subLearner.setTreeWeight(treeWeight / bagCount);
    for (int iteration = 1; iteration <= bagCount; iteration++) {
      System.out.println("Iteration: " + iteration);
      Sample subLearnerTrainSet = trainSet.getRandomSubSample(baggingTrainFraction, rnd);
      //((TreeLearner) subLearner).setRnd();
      Sample subLearnerOutOfTrainSet = trainSet.getOutOfSample(subLearnerTrainSet);
      Sample subLearnerValidSet = (validSet == null || validSet.isEmpty() ? subLearnerOutOfTrainSet : validSet);
      Ensemble subEnsemble = subLearner.learn(subLearnerTrainSet, subLearnerValidSet);

      for (int t = 0; t < subEnsemble.getNumTrees(); t++) {
        Tree tree = subEnsemble.getTreeAt(t);
        double curTreeWeight = subEnsemble.getWeightAt(t);
        if (backfit) {
          tree.backfit(subLearnerOutOfTrainSet);
        }
        ensemble.addTree(tree, curTreeWeight);
        System.out.println(tree.numLeaves);
      }

      if (validSet != null && !validSet.isEmpty()) {
        for (int t = 0; t < subEnsemble.getNumTrees(); t++) {
          validPredictions.update(subEnsemble.getTreeAt(t), 1.0 / bagCount);
        }
        lastValidMeasurement = validPredictions.evaluate(evaluationMetric);
        if (printIntermediateValidMeasurements) {
          printValidMeasurement(iteration, lastValidMeasurement, evaluationMetric);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.