Skip to content

Help tool: debug and plot network activity #9

@snowgoon88

Description

@snowgoon88

Hello,

I've made myself a "tool" to help me understand/debug/build player behavior. The idea is to have, along side, the agent moving in the top-down view and some plots which monitor some selected neurons activity.

Running:

$> python debug_plot.py info_switcher.json

using this JSON file will automatically use the model from player_switcher.player_switcher() for debug+plot

{
    "player": {
        "module": "player_switcher",
        "func":   "switcher_player"
    },
    "neurons": {
        "nni": {
            "indices": [0, 63, 33, 65],
            "labels":  ["L", "R", "C", "nrj"],
            "lim":     [-0.05, 1.05]
        },
        "nnx": {
            "indices": [77, 96],
            "labels":  ["X_f", "X_t"],
            "lim":     [-0.05, 1.05]
        },
        "nno": {
            "indices": [0],
            "labels":  ["out"],
            "lim":     [-6.1, 6.1]
        }
    }

and gets me this kind of output https://github.com/snowgoon88/braincraft/blob/dev_graph/data/fig_debug_plot_switcher.png

I am not sure this can find its place in the braincraft repo, but you can play with it (in the dev_graph branch of my forked repo: https://github.com/snowgoon88/braincraft/tree/dev_graph)

warning: I had to slightly alter "player_switcher.py" and "player_switcher_alt.py" to make them work with "debug_plot.py", but not changing at all their model. Added import numpy as np at the beginning of files and make sure that the output Ovector is a 2D numpy array. (@vforch uses simple 1D vector).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions