Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*

23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM java:8

RUN wget -q https://services.gradle.org/distributions/gradle-2.12-bin.zip \
&& unzip -q gradle-2.12-bin.zip -d /opt \
&& rm gradle-2.12-bin.zip

ENV GRADLE_HOME /opt/gradle-2.12
ENV GRADLE_OPTS -Dorg.gradle.daemon=true
ENV PATH $GRADLE_HOME/bin:$PATH

RUN wget -q http://apache.mirrors.pair.com/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip \
&& unzip -q apache-maven-3.3.9-bin.zip -d /opt \
&& rm apache-maven-3.3.9-bin.zip

ENV M2_HOME /opt/apache-maven-3.3.9
ENV PATH $M2_HOME/bin:$PATH

# Prepare a user account for use at runtime. boot2docker uses uid 1000.
RUN useradd --uid 1000 -m vagrant
USER vagrant
WORKDIR /home/vagrant

CMD ["bash"]
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ By working closely with Numenta and receiving their enthusiastic support and gui

Please refer to the [Network API Quick Start Guide](https://github.com/numenta/htm.java/wiki/NAPI-Quick-Start-Guide)

## Build Instructions

In brief:
```
gradle -Pskipbench check
```

Full instructions for building **HTM.java** are available here: [Build Instructions](https://github.com/numenta/htm.java/wiki/Build-Instructions)

## Development Environment Installation

The following instructions are for setting up a development environment (which is the only installation required)
Expand All @@ -97,20 +106,6 @@ An Eclipse IDE .project and .classpath file are provided so that the cloned proj

In addition, there are "launch configurations" for all of the tests and any runnable entities off of the "htm.java" main directory. These may be run directly in Eclipse by right-clicking them and choosing "run".

## After download by clone or fork:

Execute a quick sanity check by running all the tests from within the \<path to git repo\>/htm.java
```
gradle check # Executes the tests and runs the benchmarks

--or--

gradle -Pskipbench check # Executes the tests w/o running the benchmarks
```
**Note:** Info on installing **gradle** can be found on the wiki (look at #3.) [here](https://github.com/numenta/htm.java/wiki/Eclipse-Setup-Tips)

**Linux Gradle Issues?** [see the wiki here.](https://github.com/numenta/htm.java/wiki/Gradle---JAVA_HOME-Issue-Resolution)

## Project Integration (New)
For tips and insights on how to use the Network API to add HTM's into your own applications, see:

Expand Down
20 changes: 10 additions & 10 deletions src/test/java/org/numenta/nupic/network/PALayerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,6 @@ public void testHalt() {
final Layer<int[]> l = new PALayer<>(n);
l.add(htmSensor);

l.start();

l.subscribe(new Observer<Inference>() {
@Override public void onCompleted() {
assertTrue(l.isHalted());
Expand All @@ -263,6 +261,8 @@ public void testHalt() {
@Override public void onNext(Inference output) {}
});

l.start();

try {
l.halt();
l.getLayerThread().join();
Expand Down Expand Up @@ -292,8 +292,6 @@ public void testReset() {
final Layer<int[]> l = new PALayer<>(n);
l.add(htmSensor);

l.start();

l.subscribe(new Observer<Inference>() {
@Override public void onCompleted() {}
@Override public void onError(Throwable e) { e.printStackTrace(); }
Expand All @@ -304,6 +302,8 @@ public void testReset() {
}
});

l.start();

try {
l.getLayerThread().join();
assertEquals(3, trueCount);
Expand Down Expand Up @@ -332,8 +332,6 @@ public void testSequenceChangeReset() {
final Layer<int[]> l = new PALayer<>(n);
l.add(htmSensor);

l.start();

l.subscribe(new Observer<Inference>() {
@Override public void onCompleted() {}
@Override public void onError(Throwable e) { e.printStackTrace(); }
Expand All @@ -344,6 +342,8 @@ public void testSequenceChangeReset() {
}
});

l.start();

try {
l.getLayerThread().join();
assertEquals(3, seqResetCount);
Expand Down Expand Up @@ -377,8 +377,6 @@ public void testLayerWithObservableInput() {
final Layer<int[]> l = new PALayer<>(n);
l.add(htmSensor);

l.start();

l.subscribe(new Observer<Inference>() {
int idx = 0;
@Override public void onCompleted() {}
Expand All @@ -396,6 +394,8 @@ public void testLayerWithObservableInput() {
}
});

l.start();

try {
String[] entries = {
"7/2/10 0:00,21.2",
Expand Down Expand Up @@ -438,8 +438,6 @@ public void testLayerWithObservableInputIntegerArray() {
final Layer<int[]> l = new PALayer<>(n);
l.add(htmSensor);

l.start();

String input = "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, "
+ "1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, "
+ "0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "
Expand Down Expand Up @@ -469,6 +467,8 @@ public void testLayerWithObservableInputIntegerArray() {
}
});

l.start();

try {
String[] entries = {
input
Expand Down