コード例 #1
0
ファイル: Runner.py プロジェクト: nico202/pyNeMo
    neurons = networks[1][4]
    synapses = networks[1][5]
    network_name = networks[1][6]

    #Save Config
    dict_config = {
        "neurons": neurons,
        "sensory_neurons": (sensory_neurons_in, sensory_neurons_out),
        "save": to_save,
        "step_input": stimuli_dict,
        "synapses": synapses,
        "name": network_name
    }

    config_dict_hash = hashDict(dict_config)
    saveKey(config_dict_hash + "_input"
            , dict_config
            , output_dir)

    saveFile(
        config_file_name
        , output_dir + "/" + config_dict_hash + "_input.py")

    #Define robot
    if sensory_neurons_in or sensory_neurons_out:
        robot = RobotYARP(mode=args.robot_mode)
    else:
        robot = None
    #TODO: Reset robot original position? (and maybe gz-world status?)
    if robot:
コード例 #2
0
ファイル: Batch.py プロジェクト: nico202/pyNeMo
            commands.append(input_string)
            return commands

    return substituteRanges(commands, commands)

commands = substituteRanges([args], [])

#fix parentheses:
commands = [ i for i in commands if not missing(i) ]

#set just to be sure no duplicate runs
real_commands = set(commands)

#TODO:
#FIXME: remove "--show-image" etc to prevent different hashes of same config
session_hash = hashDict(real_commands)

#Save commands list
is_folder("./commands")
commands_file = "./commands/" + session_hash + "_commands"
cprint ("Saving %s commands to file: %s" % (len(real_commands), commands_file), 'info')
saveKey(commands_file, commands)
# Debug: re-enable in release
# cprint("Running in 5s", "warning")
# time.sleep(5)

#Start
is_folder (output_dir)

cprint("We'll use %s as output dir" % (output_dir), 'info')