예제 #1
0
파일: Network.java 프로젝트: sawie/htm.java
  /**
   * Used to manually input data into a {@link Network}, the other way being the call to {@link
   * Network#start()} for a Network that contains a Region that contains a {@link Layer} which in
   * turn contains a {@link Sensor} <em>-OR-</em> subscribing a receiving Region to this Region's
   * output Observable.
   *
   * @param input One of (int[], String[], {@link ManualInput}, or Map&lt;String, Object&gt;)
   */
  public <T> void compute(T input) {
    if (tail == null && regions.size() == 1) {
      this.tail = regions.get(0);
    }

    if (head == null) {
      addDummySubscriber();
    }

    tail.compute(input);
  }
예제 #2
0
파일: Network.java 프로젝트: sawie/htm.java
  /**
   * Used to manually input data into a {@link Network} in a synchronous way, the other way being
   * the call to {@link Network#start()} for a Network that contains a Region that contains a {@link
   * Layer} which in turn contains a {@link Sensor} <em>-OR-</em> subscribing a receiving Region to
   * this Region's output Observable.
   *
   * @param input One of (int[], String[], {@link ManualInput}, or Map&lt;String, Object&gt;)
   */
  public <T> Inference computeImmediate(T input) {
    if (tail == null && regions.size() == 1) {
      this.tail = regions.get(0);
    }

    if (head == null) {
      addDummySubscriber();
    }

    tail.compute(input);
    return head.getHead().getInference();
  }