How to use the causality.common.PerceptualModel function in causality

To help you get started, we’ve selected a few causality examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mjedmonds / OpenLock / causality / causal_planner.py View on Github external
def load_trial(demonstration_file, perceptual_file):

    data, col_labels, fluent_vecs, action_vecs, fluent_labels, action_labels = load_csv(
        demonstration_file
    )
    perceptual_model = common.PerceptualModel(perceptual_file)

    # perceptual_model.pretty_print()

    causal_planner = CausalPlanner(fluent_labels, action_labels, perceptual_model)

    causal_planner.compute_action_seqs(fluent_vecs, action_vecs)

    return causal_planner
github mjedmonds / OpenLock / causality / counterfactuals.py View on Github external
def main():
    data_dir = "../OpenLock/scenario_outputs/action_reversal/output_node_"
    trial_name = "ex1_extended"

    perceptual_model = cc.PerceptualModel(data_dir + trial_name + ".mat")

    # tabulate full fluent space
    fluent_space = cc.tabulate(perceptual_model.fluents)

    print("All done!")