Git Product home page Git Product logo

destin's Introduction

DeSTIN

Papers about DeSTIN

Current Work

Implementing uniform destin described here: http://wiki.opencog.org/w/DestinOpenCog

Creating enhanced visualization capabilities.

For more detailed development progress see Diary.md

Building

Instructions below are for Ubuntu.

See Windows build instructions at https://github.com/opencog/destin/blob/master/WindowsBuild.md

You may build docker image containing all dependencies apart from CUDA SDK by using https://github.com/opencog/destin/blob/master/Dockerfile

Dependencies:

  • CMake (2.8.x, >= 3.2)
  • OpenCV 2 (libopencv-dev)

Java Bindings: JDK, ant and SWIG 2.x

Python Bindings: python-dev (tested with python 2.7), python-opencv, and SWIG 2.x

To build DrentheDestin, CUDA SDK is required.

Individual parts can be skipped by commenting out their ADD_SUBDIRECTORY line in the CMakeLists.txt Some examples:

  • If you dont have CUDA for example, comment out the "ADD_SUBDIRECTORY(DrentheDestin)" in Destin/CMakeLists.txt

  • If you dont want to install any language bindings comment out "ADD_SUBDIRECTORY(Bindings)" in Destin/CMakeLists.txt.

  • If you want python bindings but not Java, then in Destin/Bindings/CMakeLists.txt comment out "add_subdirectory(Java)"

Building:

$ git clone http://github.com/opencog/destin.git
$ cd destin
$ git submodule init
$ git submodule update
$ cd Destin
$ cmake . 
$ make

Rebuilding:

During development sometimes CMake is not able to detect dependencies between the different built libraries. So it is recommened to do a "make clean" and "make -j4" (j4 lets you use multiple cores) from the Destin directory to make sure everyting is building fresh.

Building Java Bindings:

The native jni bindings lib is built with CMake, the actual java program which uses it is built with java_build.sh:

$ cd Destin/Bindings/Java
$ ./java_build.sh
$ ./java_run.sh

Show me something!

Currently the most interesting things to see are the scripts in the Destin/Bindings/Python directory. These scripts are meant to be used interactivly so I recommend installing and using idle for python ( search for and install the idle package).

To see a self organizing map (SOM):

Manually download http://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz

$ tar xf cifar-10-binary.tar.gz
$ cd cifar-10-batches-bin
$ pwd

Note the absolute path

$ cd Destin/Bindings/Python

Edit som.py and edit the cifar_dir variable near the top and change it to the absolute path of the cifar-10-batches-bin directory

$ idle som.py

Two windows appear, select the som.py window and click Run->Run Module (F5). Training will begin, after less than 5 minutes the SOM will popup.

To see DeSTIN train on an video and see its output:

$ cd Destin/Bindings/Python
$ idle dostuff.py

Two windows should appear.

- select the dostuff.py window
- click Run -> Run Modedule ( F5 )

You should see a video of a hand and windows for 8 layers.

In the other "Python Shell" window you can interact with the code after its done with 500 frames ( about a minute). To make it continue processing type go(100) to have it process 100 more frames. You can make it train on webcam input instead by changing the line:

vs = pd.VideoSource(False, "hand.m4v")

to

vs = pd.VideoSource(True, "")

destin's People

Contributors

alex-van-der-peet avatar amo3 avatar cottonaf avatar jswiergo avatar linas avatar tedyhabtegebrial avatar tpsjr7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

destin's Issues

som.py function problem

For me, running idle som.py on Ubuntu 16.04 x64 prodcues a window, as expected. Pressing <F5> in this window produces another window, which outputs an error message:

=== RESTART: /home/enoch/the_machine/destin/Destin/Bindings/Python/som.py ===

Traceback (most recent call last):
File "/home/enoch/the_machine/destin/Destin/Bindings/Python/som.py", line 41, in
dn = pd.DestinNetworkAlt(pd.W32, layers, centroids, is_uniform)
File "/home/enoch/the_machine/destin/Destin/Bindings/Python/pydestin.py", line 1668, in init
this = _pydestin.new_DestinNetworkAlt(width, layers, centroid_counts, isUniform, layer_widths, imageMode)
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_DestinNetworkAlt'.
Possible C/C++ prototypes are:
DestinNetworkAlt::DestinNetworkAlt(SupportedImageWidths,unsigned int,unsigned int [],bool,unsigned int [],DstImageMode)
DestinNetworkAlt::DestinNetworkAlt(SupportedImageWidths,unsigned int,unsigned int [],bool,unsigned int [])
DestinNetworkAlt::DestinNetworkAlt(SupportedImageWidths,unsigned int,unsigned int [],bool)

Still active?

It seems like the last update was about 4 months ago, and the last diary.md entry was 3 years ago. What's the current status of this project? Is it still active?

Build problem in Ubuntu

Something is preventing Bindings/Python/swig_destin_pythonPYTHON_wrap.cxx from being generated.

Same thing with Java but I've disabled it for now.

I've followed all the steps, but did however upgrade to Ubuntu 15.04 a few hours ago, hopefully that has nothing to do with this problem, I did not try building DeSTIN in v14.10. atomspace/opencog is built ok on 15.04.

...
[ 76%] Built target test
[ 79%] Building C object SOM/CMakeFiles/som.dir/cluster/src/cluster.c.o
Linking CXX shared library libsom.so
[ 79%] Built target som
Scanning dependencies of target _pydestin
make[2]: *** No rule to make target 'Bindings/Python/swig_destin_pythonPYTHON_wrap.cxx', needed by 'Bindings/Python/CMakeFiles/_pydestin.dir/swig_destin_pythonPYTHON_wrap.cxx.o'. Stop.
CMakeFiles/Makefile2:564: recipe for target 'Bindings/Python/CMakeFiles/_pydestin.dir/all' failed
make[1]: *** [Bindings/Python/CMakeFiles/_pydestin.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

Thanks in advance for any assistance!

Make dies

On Ubuntu 16.04 x64 everything in building apparently works, and make
dies with

CMakeFiles/testSOM.dir/TestSom.cpp.o: In function test_SOM_demo()': TestSom.cpp:(.text+0xb2e): undefined reference tosomcluster'
TestSom.cpp:(.text+0x1090): undefined reference to clusterdistance' TestSom.cpp:(.text+0x14e0): undefined reference toclusterdistance'
CMakeFiles/testSOM.dir/TestSom.cpp.o: In function test_org()': TestSom.cpp:(.text+0x298f): undefined reference tosomcluster'
CMakeFiles/testSOM.dir/TestSom.cpp.o: In function ClusterSom::distance(float*, float*)': TestSom.cpp:(.text._ZN10ClusterSom8distanceEPfS0_[_ZN10ClusterSom8distanceEPfS0_]+0x3a4): undefined reference toclusterdistance'
CMakeFiles/testSOM.dir/TestSom.cpp.o: In function ClusterSom::train(int)': TestSom.cpp:(.text._ZN10ClusterSom5trainEi[_ZN10ClusterSom5trainEi]+0x60): undefined reference tosomcluster'
CMakeFiles/testSOM.dir/TestSom.cpp.o: In function ClusterSom::findBestMatchingUnit(float*)': TestSom.cpp:(.text._ZN10ClusterSom20findBestMatchingUnitEPf[_ZN10ClusterSom20findBestMatchingUnitEPf]+0x281): undefined reference toclusterdistance'
CMakeFiles/testSOM.dir/TestSom.cpp.o: In function ClusterSom::distance_coords(int, int, int, int)': TestSom.cpp:(.text._ZN10ClusterSom15distance_coordsEiiii[_ZN10ClusterSom15distance_coordsEiiii]+0x80): undefined reference toclusterdistance'
CMakeFiles/testSOM.dir/TestSom.cpp.o: In function SomPresentor::showSimularityMap(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, int, int)': TestSom.cpp:(.text._ZN12SomPresentor17showSimularityMapENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjii[_ZN12SomPresentor17showSimularityMapENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjii]+0x26e): undefined reference toclusterdistance'
collect2: error: ld returned 1 exit status
SOM/CMakeFiles/testSOM.dir/build.make:113: recipe for target 'SOM/testSOM' failed
make[2]: *** [SOM/testSOM] Error 1
CMakeFiles/Makefile2:864: recipe for target 'SOM/CMakeFiles/testSOM.dir/all' failed
make[1]: *** [SOM/CMakeFiles/testSOM.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 71%] Building CXX object Common/CMakeFiles/common.dir/VideoWriter.cpp.o
[ 72%] Building CXX object Common/CMakeFiles/common.dir/DestinTreeManager.cpp.o
[ 74%] Linking C executable test/test
[ 74%] Built target test
[ 76%] Linking CXX shared library libcommon.so
[ 76%] Built target common
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Before that, cmake . outputs

-- Configuring done

CMake Error at SOM/CMakeLists.txt:3 (add_library):
Cannot find source file:

cluster/src/cluster

Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx

-- Generating done

I'm using cmake 3.5.1 and gcc 5.4.0

What am I doing wrong?

Some unit tests do not pass (testForumateStages, testUniform)

Running testForumateStages
ni: 1, nb: 2, np: 0, ns: 3, nc: 0
assertFloatArrayEquals FAILED, line: 160, on index 0 with array length 2
expected: 2.000000e+01, actual: 9.523810e-01, difference: 1.904762e+01
FAILED
Running testUniform
assertFloatEquals FAILED, line: 278, expected: 16.666667, actual: 0.943396, difference: 1.572327e+01
FAILED

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.