Figure 3

The following script was used to generate the graphs of Figure 3 of the article "Behavioral Diversity Generation in Autonomous Exploration Through Reuse of Past Experience" by Fabien C. Y. Benureau and Pierre-Yves Oudeyer.

The full code is available and is distributed under the Open Science License. For any questions, remarks or difficulties running this code, contact fabien.benureau@gmail.com.

In [1]:
import random
import copy

import environments

import dotdot
import envs
import graphs


DIM = 20
RANGE = 150


# instanciating the two environments
env_name, env_cfg = envs.kin(dim=DIM, limit=RANGE)
env = environments.Environment.create(env_cfg)

lengths = [0.9**i for i in range(DIM)]
lengths = [s/sum(lengths) for s in lengths]
env2_name, env2_cfg = envs.kin(dim=DIM, limit=RANGE, lengths=lengths)
env2 = environments.Environment.create(env2_cfg)


# defining postures
random.seed(0)
m_channels = copy.deepcopy(env.m_channels)
for i in range(DIM-1):
    m_channels[i].bounds = (-45, 45)
m_signals = [environments.tools.random_signal(m_channels) for _ in range(50)]


# selecting some proeminent postures
selected = [m_signals[i] for i in [0, 1, 2, 3, 5, 9]]


# spreading their first joints to avoid superpositions
m_signals[0]['j{}'.format(DIM-1)] =  100.0
m_signals[1]['j{}'.format(DIM-1)] = -150.0
m_signals[2]['j{}'.format(DIM-1)] =  -30.0
m_signals[3]['j{}'.format(DIM-1)] =   50.0
m_signals[5]['j{}'.format(DIM-1)] =  -50.0
m_signals[9]['j{}'.format(DIM-1)] =   20.0


# making graphs
graphs.output_notebook()

fig = None
for kin_env, color in zip([env, env2], ['#666666', '#E84A5F']):
    fig = graphs.posture_signals(kin_env, m_signals, fig=fig,
                                 color=color, alpha=0.1, radius_factor=0.5)
for kin_env, color in zip([env, env2], ['#666666', '#E84A5F']):
    fig = graphs.posture_signals(kin_env, selected, fig=fig,
                                 color=color, alpha=0.75, radius_factor=0.5)
graphs.show(fig)

Provenance Data

In [2]:
import provenance
prov_data = provenance.planar_arms()
print(prov_data.message())
All the code involved in the execution of this notebook is commited (no git repository in dirty state).
This notebook was executed with commit efe8d71f8242d148d3d1825f0157a48b458eb1d9.

Installed research packages (available in the submodules/ directory):
    clusterjobs  [7505201203af95d3b1074d751c0afac76f3cc619]
    environments [f1937e2ab3a381b29c6a096c9e676d502ed84ce7]
    experiments  [14acbd38d66f996f19e35f3b0a749fc9585fb03f]
    explorers    [1d284f3b1479b935f94b99b8e12c1e9432963421]
    fastlearners [870e9d472f50c0920b66b8f10df1823dbcd9d659]
    learners     [c43380e0e0cd7e6f914dbd9cd2e62e1d87003abc]
    scicfg       [63c4c5c794114ed1606124806b55aa6a56ecb689]

Installed third-party python packages:
    numpy 1.10.4
    scipy 0.17.0
    shapely 1.5.13
    sklearn 0.17

Installed third-party non-python packages:
    geos 3.5.0

Executed with:
    CPython 2.7.11 ('default', 'Feb  2 2016 04:42:29')
    [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]
    on Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64