Skip to content

Commit

Permalink
Modify READMEs and CMake config files to adjust to miner split
Browse files Browse the repository at this point in the history
  • Loading branch information
ngeiswei committed Jul 16, 2019
1 parent 5a55975 commit bed66dc
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 739 deletions.
400 changes: 17 additions & 383 deletions CMakeLists.txt

Large diffs are not rendered by default.

238 changes: 47 additions & 191 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,206 +1,62 @@
OpenCog
=======

[![CircleCI](https://circleci.com/gh/opencog/opencog.svg?style=svg)](https://circleci.com/gh/opencog/opencog)

OpenCog is a framework for developing AI systems, especially appropriate
for integrative multi-algorithm systems, and artificial general intelligence
systems. Though much work remains to be done, it currently contains a
functional core framework, and a number of cognitive agents at varying levels
of completion, some already displaying interesting and useful functionalities
alone and in combination.

The main project site is at http://opencog.org

Overview
--------
OpenCog consists of multiple components. At its core is a (hyper-)graph
database, the [AtomSpace](http://github.com/opencog/atomspace), which is
used for representing knowledge and algorithms, providing a surface on
which learning and reasoning algorithms are implemented. The AtomSpace
consists of an in-RAM database, a "query language" aka "pattern matcher",
a (ProLog-like) rule system, including forward and backward chainers,
and an evaluator for the internal "programming langauge", Atomese. This
language is not really meant to be used by humans (although, defacto,
it is) but rather, it is a language for representing knowledge and
algorithms, on which (automated) reasoning and learning can be performed.
The AtomSpace also provides Scheme (guile) and Python bindings. The
AtomSpace is maintained in a separate git repo:
http://github.com/opencog/atomspace

This git repository contains assorted projects that are central to the
OpenCog project, but are not yet mature or stable, and are subject to
active development and experimentation. These include:
* An assortment of natural language processing subsystems, including:
* Natural language generation (for expressiong thoughts as sentences).
* Natural language input (for reading and hearing).
* Assorted chatbots, some of which are embodied.
* PLN, a probabilistic reasoning and inference system.
* Attention Allocation, for managing combinatoric explosion during
reasoning and language generation.
* Space-time servers, for managing spatial and time data (grounding
common-sense natural language concepts such as "next-to", "nearby",
and "soon".)
* An embodiment subsystem, attaching language to visual and auditory
senses. This is primarily located in the
[ROS Behavior Scripting](https://github.com/opencog/ros-behavior-scripting)
repository.
* OpenPsi, a model of psychological states. Its currently a mashup of
two unrelated ideas: a generic rule-class selection and plannning
system, and a model of human psychological states. An open to-do item
is to untangle these two.
* An unsupervised learning system or "pattern miner", for extracting
"surprising" patterns.
* A supervised learning system, MOSES, for extracting patterns from
tabular data. This is located in a seprate repository,
[MOSES](https://github.com/opencog/moses).
* The CogServer, a network server providing shell access and a REST API.
* Several (obsolete!?) data visualization subsystems.

With the exception of MOSES and the CogServer, all of the above are in
active development, are half-baked, poorly documented, mis-designed,
subject to experimentation, and generally in need of love an attention.
This is where experimentation and integration are taking place, and,
like any laboratory, things are a bit fluid and chaotic.


Building and Running
--------------------
For platform dependent instruction on dependencies and building the
code, as well as other options for setting up development environments,
more details are found on the [Building Opencog
wiki](http://wiki.opencog.org/wikihome/index.php/Building_OpenCog).

There is no single "demo" or system that can be "run"; rather, the
various subsystems can be run individually, or together. The single
most-fully-integrated, complete demo would be the embodied [Hanson
Robotics](http://github.com/hansonrobotics) chat subsystem. This
can be run *without* having an actual robot; a virtual Blender
animation may be used instead; a webcam and microphones are required
for sensory input. Portions of this system can be found in the `nlp`
directory, in this repo, as well as the
[ROS Behavior Scripting](https://github.com/opencog/ros-behavior-scripting)
repo. The full setup is located in the Hanson Robotics
[HEAD](https://github.com/hansonrobotics/HEAD) repo, and ready-to-run
Docker images can be found in the [OpenCog Docker
repo](https://github.com/opencog/docker).


Prerequisites
-------------
To build and run OpenCog, the packages listed below are required.
With a few exceptions, most Linux distributions will provide these
packages. Users of Ubuntu 14.04 "Trusty Tahr" may use the dependency
installer at `/scripts/octool`. Users of any version of Linux may
use the Dockerfile to quickly build a container in which OpenCog will
be built and run.

###### cogutil
> Common OpenCog C++ utilities
> http://github.com/opencog/cogutil
> It uses exactly the same build procedure as this package. Be sure
to `sudo make install` at the end.

###### atomspace
> OpenCog Atomspace database and reasoning engine
> http://github.com/opencog/atomspace
> It uses exactly the same build procedure as this package. Be sure
to `sudo make install` at the end.

###### libuuid
> Library for generating UUID's
> Used by various internal subsystems.
> `sudo apt-get install uuid-dev`
Optional Prerequisites
----------------------
The following packages are optional. If they are not installed, some
optional parts of OpenCog will not be built. The CMake command, during
the build, will be more precise as to which parts will not be built.

###### Link Grammar
> Natural Language Parser for English, Russian, other languages.
> Required for natural language generation, and the chatbot.
> http://www.abisource.com/projects/link-grammar/
###### MOSES
> MOSES Machine Learning
> http://github.com/opencog/moses
> It uses exactly the same build proceedure as this package. Be sure
to `sudo make install` at the end.

###### OctoMap
> 3D occupancy grid mapping library
> Required for the robot perception subsystem.
> `sudo apt-get install liboctomap-dev`
###### URE
> Unified Rule Engine
> http://github.com/opencog/ure
> Required for NLP, PLN and pattern miner
> It uses exactly the same build proceedure as this package. Be sure
to `sudo make install` at the end.

Obsolete Prerequisites
----------------------
The following packages are needed to build some of the old, obsolete
packages.

###### CppREST
> C++ HTTP RESTful interfaces
> Used by the Pattern miner for distributed processing (this will be
replaced by gearman in future releases).
> `sudo apt-get install libcpprest-dev`
###### Threading Building Blocks
> C++ template library for parallel programming
> Used to implement the optional REST API. (TODO: the REST API should
be refactored to not use TBB)
> `sudo apt-get install libtbb-dev`
Building OpenCog
----------------
# Miner

[![CircleCI](https://circleci.com/gh/opencog/miner.svg?style=svg)](https://circleci.com/gh/opencog/miner)

The miner (or pattern miner) is a frequent and surprise subhypergraph
pattern miner for the AtomSpace. It is built on top of the URE to take
advantage of the URE refined control capabilities.

## Building and Installing

### Prerequisites

To build the miner you need to build and install the
[URE](https://wiki.opencog.org/w/URE) first, see
[Building-and-installing-the-URE](https://github.com/opencog/ure#building-and-installing)
for more information.

### Building Miner

Be sure to install the pre-requisites first!
Perform the following steps at the shell prompt:
```
cd to project root dir
cd miner
mkdir build
cd build
cmake ..
make
make -j
```
Libraries will be built into subdirectories within build, mirroring
the structure of the source directory root.

### Unit tests

Unit tests
----------
To build and run the unit tests, from the `./build` directory enter
(after building opencog as above):
```
make test
make -j test
```
Tests can be run in parallel as well:
```
make -j test ARGS=-j4
```

CMake notes
-----------
Some useful CMake's web sites/pages:

- http://www.cmake.org (main page)
- http://www.cmake.org/Wiki/CMake_Useful_Variables
- http://www.cmake.org/Wiki/CMake_Useful_Variables/Get_Variables_From_CMake_Dashboards
- http://www.cmake.org/Wiki/CMakeMacroAddCxxTest
- http://www.cmake.org/Wiki/CMake_HowToFindInstalledSoftware


The main CMakeLists.txt currently sets -DNDEBUG. This disables Boost
matrix/vector debugging code and safety checks, with the benefit of
making it much faster. Boost sparse matrixes and (dense) vectors are
currently used by ECAN's ImportanceDiffusionAgent. If you use Boost
ublas in other code, it may be a good idea to at least temporarily
unset NDEBUG. Also if the Boost assert.h is used it will be necessary
to unset NDEBUG. Boost ublas is intended to respond to a specific
BOOST_UBLAS_NDEBUG, however this is not available as of the current
Ubuntu standard version (1.34).

-Wno-deprecated is currently enabled by default to avoid a number of
warnings regarding hash_map being deprecated (because the alternative
is still experimental!)
### Install

After building, you must install the pattern miner.
```
sudo make install
```

## Examples

Examples can be found in this repository under

[Miner examples](examples/miner)

## More info

The primary documentation for the pattern miner is here:

* [Pattern Miner wiki](https://wiki.opencog.org/w/Pattern_miner)
* [Pattern Miner README.md](opencog/miner/README.md)
34 changes: 0 additions & 34 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,4 @@ first, as that provides most of the simpler examples, as well as showing
how to use the core infrastructure. The examples here domonstrate
mostly higher-level systems.


python - Python usage examples. Most of these are probably
obsolete, or mis-categorized, or unmaintained. Needs
cleanup.

sureal - Demonstrates how to use the Surface Realization
system, for generating grammatically valid English
language sentences from abstract conceptual
diagrams.

openpsi - An example implementation of openpsi to control a simple
agent.

miner - Collection of examples of the pattern miner.

Stale Examples:
---------------
The following examples illustrate subsystems that are not currently
maintained, and may be broken or non-operational.

conceptual_blending - Blending together of similar concepts.

hopfield - Provides a toy example for Economic Attention
Allocation Networks, emulating a type of associative
memory neural network called a 'Hopfield network'.

Deprecated examples:
--------------------
The strategic direction for opencog is to move away from the current
cogserver + modules + agents design, and to encourage coding entirely
in either scheme and python. Thus, please reconsider creating new
agents using these deprecated C++ interfaces.

module - Provides a template for creating a custom module.
agents - Provides a template for creating a custom agent.
4 changes: 2 additions & 2 deletions examples/miner/simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ guile -l simple.scm

or paste scheme commands one by one in guile.

The results should have been stored in the `results` variable, which
can be shown as follows:
The results should have been stored in the `results-as` and
`results-lst` variables, which can be shown as follows:

```scheme
results-as
Expand Down
58 changes: 5 additions & 53 deletions opencog/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,58 +1,10 @@

# The atom_types.h file is written to the build directory
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})

DECLARE_GUILE_CONFIG_TARGET(SCM_CONFIG "opencog oc-config" "OPENCOG_TEST")

# The build order used here is loosely in terms of
# dependencies: the later parts depend on, or may
# someday depend on the earlier parts.
#
ADD_SUBDIRECTORY (attentionbank)
ADD_SUBDIRECTORY (neighbors)
ADD_SUBDIRECTORY (learning)

IF (HAVE_ATOMSPACE)
ADD_SUBDIRECTORY (nlp)
ADD_SUBDIRECTORY (spacetime)
ENDIF (HAVE_ATOMSPACE)

IF (HAVE_SERVER)
ADD_SUBDIRECTORY (cogserver)
# attention builds *after* cogserver.
ADD_SUBDIRECTORY (attention)
ENDIF(HAVE_SERVER)

IF (HAVE_ATOMSPACE AND HAVE_GUILE)
ADD_SUBDIRECTORY (scm)
ADD_SUBDIRECTORY (eva)
ENDIF (HAVE_ATOMSPACE AND HAVE_GUILE)

IF (HAVE_OPENPSI)
ADD_SUBDIRECTORY (openpsi)
ENDIF (HAVE_OPENPSI)

IF (HAVE_NLP)
ADD_SUBDIRECTORY (ghost)
ENDIF (HAVE_NLP)

IF (HAVE_PLN)
ADD_SUBDIRECTORY (pln)
ENDIF (HAVE_PLN)

IF (HAVE_CYTHON)
ADD_SUBDIRECTORY (cython)
ADD_SUBDIRECTORY (python)
ENDIF (HAVE_CYTHON)

# Graphics and visualization subsystems
ADD_SUBDIRECTORY (visualization)
DECLARE_GUILE_CONFIG_TARGET(SCM_CONFIG "opencog miner-config" "MINER_TEST")

IF (HAVE_MINER)
ADD_SUBDIRECTORY (miner)
ADD_SUBDIRECTORY (miner)
ENDIF (HAVE_MINER)

WRITE_GUILE_CONFIG(${GUILE_BIN_DIR}/opencog/oc-config.scm SCM_CONFIG TRUE)
WRITE_GUILE_CONFIG(${GUILE_BIN_DIR}/opencog/miner-config.scm SCM_CONFIG TRUE)

WRITE_GUILE_CONFIG(${GUILE_BIN_DIR}/opencog/oc-config-installable.scm SCM_CONFIG FALSE)
INSTALL(FILES ${GUILE_BIN_DIR}/opencog/oc-config-installable.scm DESTINATION ${GUILE_SITE_DIR}/opencog RENAME oc-config.scm)
WRITE_GUILE_CONFIG(${GUILE_BIN_DIR}/opencog/miner-config-installable.scm SCM_CONFIG FALSE)
INSTALL(FILES ${GUILE_BIN_DIR}/opencog/miner-config-installable.scm DESTINATION ${GUILE_SITE_DIR}/opencog RENAME miner-config.scm)
Loading

0 comments on commit bed66dc

Please sign in to comment.