Package com.greentea.relaxation.jnmf.model

Examples of com.greentea.relaxation.jnmf.model.Layer


   public void beforeStep()
   {
      if (isFirstStep)
      {
         isFirstStep = false;
         Layer lastLayer = builder.getNetwork().getLayers().getLast();
         for (int i = 0; i < targetImage.length(); ++i)
         {
            Neuron owner = lastLayer.getNeurons().get(i);
            Double value = targetImage.charAt(i) == '0' ? -1.0 : 1.0;
            owner.getOutputSynapses().get(0).sendSignal(owner, value);
//            ThresholdFunction function
//               = (ThresholdFunction) owner.getActivationFunction();
//            function.setThresholdValue(getValue);
View Full Code Here


      return ZERO;
   }

   public DoubleList getResult()
   {
      Layer last = builder.getNetwork().getLayers().getLast();

      DoubleList result = new ArrayDoubleList();
      for (Neuron neuron : last.getNeurons())
      {
         result.add(neuron.getActivation());
      }

      return result;
View Full Code Here

      createClusters(data, p, 5);
   }

   public int getClustersCount()
   {
      Layer lastLayer = getNetwork().getLayers().getLast();
      return lastLayer.getNeurons().size();
   }
View Full Code Here

      return lastLayer.getNeurons().size();
   }

   public DoubleList resolveClusterCenter(int clusterNum)
   {
      Layer lastLayer = getNetwork().getLayers().getLast();
      Neuron clusterNeuron = lastLayer.getNeurons().get(clusterNum);

      DoubleList res = new ArrayDoubleList(clusterNeuron.getInputSynapses().size());
      for (Synapse s : clusterNeuron.getInputSynapses())
      {
         res.add(s.getWeight());
View Full Code Here

   public int getCluster(DoubleList input)
   {
      step(input);

      Layer lastLayer = getNetwork().getLayers().getLast();
      return lastLayer.getMinActivationNeuronIndex();
   }
View Full Code Here

      for (int i = 0; i < learningData.getInputsCount(); ++i)
      {
         builder.addDataInputSynapseGenerative(i, 1, i);
      }

      Layer outputLayer = new Layer();
      builder.getNetwork().addLayer(outputLayer);
      builder.setSynapseClass(SignalDiferenceSynapse.class);
      builder.setNeuronClass(OutputNeuron.class);
   }
View Full Code Here

   private void changeStateToLearningCandidates()
   {
      out(CasCorState.CANDIDATES_COLLECT_INFO.toString() + " = " + (++newLayersCount));
      int numNewLayer = builder.getNetwork().getLayers().size() - 1;
      builder.getNetwork().getLayers().add(numNewLayer, new Layer());

      candidates.clear();
      for (int i = 0; i < candidatesCount; ++i)
      {
         candidates.add(builder.addNeuronGenerative(numNewLayer));

         for (int j = 0; j < numNewLayer; ++j)
         {
            Layer layer = builder.getNetwork().getLayers().get(j);
            for (int k = 0; k < layer.getNeurons().size(); ++k)
            {
               double w = JNMFMathUtils
                       .reflectToInterval(rand.nextDouble(), 0, 1, -inputWeightsOfCandidatesRange,
                               inputWeightsOfCandidatesRange);
               builder.addSynapseGenerative(j, k, w, numNewLayer, i);
View Full Code Here

      {
         for (
                 int sourceLayerIndex = 0;
                 sourceLayerIndex < network.getLayers().size(); ++sourceLayerIndex)
         {
            Layer sourceLayer = network.getLayers().get(sourceLayerIndex);

            for (int i = 0; i < sourceLayer.getNeurons().size(); ++i)
            {
               Neuron sourceNeuron = sourceLayer.getNeurons().get(i);
               String layerString = (i == 0) ? "" + sourceLayerIndex : emptyString;
               String neuronString = "" + sourceNeuronkIndex;

               Color layerColor = (sourceLayerIndex % 2 == 0) ? CellColor.EvenClass.getColor() :
                       CellColor.OddClass.getColor();
               Color neuronColor = CellColor.DefaultCell.getColor();
               row1Colors.add(layerColor);
               row2Colors.add(neuronColor);

               layersRow1.add(layerString);
               neuronsRow2.add(neuronString);

               Vector<Object> contentRow = new Vector<Object>();
               contentRow.add(layerString);
               contentRow.add(neuronString);

               List<Color> rowColors = new ArrayList<Color>();
               rowColors.add(layerColor);
               rowColors.add(neuronColor);

               for (
                       int destLayerIndex = 0;
                       destLayerIndex < network.getLayers().size(); ++destLayerIndex)
               {
                  Layer destLayer = network.getLayers().get(destLayerIndex);
                  for (Neuron destNeuron : destLayer.getNeurons())
                  {
                     double w = 0.0;

                     Color connectionColor = CellColor.DefaultCell.getColor();
                     Collection<Synapse> synapses = CollectionUtils
View Full Code Here

TOP

Related Classes of com.greentea.relaxation.jnmf.model.Layer

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.