How to use the mathy.agent.training.lessons.build_lesson_plan function in mathy

To help you get started, we’ve selected a few mathy 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 justindujardin / mathy / mathy / agent / curriculum / level1.py View on Github external
mcts_sims=500,
            max_turns=3,
            num_observations=512,
        ),
        LessonExercise(
            lesson_name="seven_terms",
            problem_count=1,
            problem_fn=lambda: simplify_multiple_terms(7),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=250,
            num_observations=512,
        ),
    ],
)

lesson_plan_3 = build_lesson_plan(
    "combine_like_terms_3",
    [
        LessonExercise(
            lesson_name="needle_in_haystack_3",
            problem_count=4,
            problem_fn=lambda: combine_terms_in_place(easy=False, powers=True),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=500,
            max_turns=3,
            num_observations=256,
        ),
        LessonExercise(
            lesson_name="three_terms_with_powers",
            problem_count=1,
            problem_fn=lambda: simplify_multiple_terms(3, powers=True),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
github justindujardin / mathy / mathy / agent / curriculum / level1.py View on Github external
max_turns=3,
            num_observations=128,
        ),
        LessonExercise(
            lesson_name="commute_grouping_2",
            problem_fn=lambda: combine_terms_after_commuting(),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            problem_count=4,
            mcts_sims=500,
            num_observations=128,
            max_turns=6,
        ),
    ],
)

green_belt = build_lesson_plan(
    "green_belt",
    [
        LessonExercise(
            lesson_name="six_terms_with_exponents",
            problem_count=4,
            problem_fn=lambda: simplify_multiple_terms(6, powers=True),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=50,
            num_observations=32,
        ),
        LessonExercise(
            lesson_name="eight_terms_with_exponents",
            problem_count=4,
            problem_fn=lambda: simplify_multiple_terms(8, powers=True),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=50,
github justindujardin / mathy / mathy / agent / curriculum / level1 / yellow_belt.py View on Github external
problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            max_turns=3,
            mcts_sims=200,
            num_observations=observations,
        ),
        LessonExercise(
            lesson_name="six_terms",
            problem_count=1,
            problem_fn=lambda: simplify_multiple_terms(6, powers_proability=0.85),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=200,
            num_observations=observations,
        ),
    ],
)
yellow_belt_practice = build_lesson_plan(
    "yellow_belt_practice",
    [
        LessonExercise(
            lesson_name="commute_blockers_1_3",
            problem_fn=lambda: move_around_blockers_one(3),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            problem_count=4,
            mcts_sims=500,
            num_observations=observations,
        ),
        LessonExercise(
            lesson_name="five_terms",
            problem_count=4,
            problem_fn=lambda: simplify_multiple_terms(5, powers_proability=0.85),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=500,
github justindujardin / mathy / mathy / agent / curriculum / level1 / purple_belt.py View on Github external
problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=purple_sims,
            num_observations=64,
        ),
        LessonExercise(
            lesson_name="ten_complex_terms_with_exponents",
            problem_fn=lambda: simplify_multiple_terms(10, powers_proability=0.85, op=None),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=purple_sims,
            num_observations=64,
        ),
    ],
)

purple_practice_sims = 250
purple_belt_practice = build_lesson_plan(
    "purple_belt_practice",
    [
        LessonExercise(
            lesson_name="five_complex_terms",
            problem_fn=lambda: simplify_multiple_terms(5, op=None),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=purple_practice_sims,
            num_observations=64,
        ),
        LessonExercise(
            lesson_name="six_complex_terms_with_exponents",
            problem_fn=lambda: simplify_multiple_terms(6, powers_proability=0.85, op=None),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=purple_practice_sims,
            num_observations=64,
        ),
github justindujardin / mathy / mathy / agent / curriculum / level1.py View on Github external
mcts_sims=500,
            num_observations=512,
        ),
        LessonExercise(
            lesson_name="ten_terms",
            problem_count=1,
            problem_fn=lambda: simplify_multiple_terms(10),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=250,
            num_observations=512,
        ),
    ],
)


lesson_plan_2 = build_lesson_plan(
    "combine_like_terms_2",
    [
        LessonExercise(
            lesson_name="twenty_four_terms",
            problem_count=1,
            problem_fn=lambda: simplify_multiple_terms(24),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=500,
            num_observations=512,
        ),
        LessonExercise(
            lesson_name="needle_in_haystack_2",
            problem_count=4,
            problem_fn=lambda: combine_terms_in_place(False),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=500,
github justindujardin / mathy / mathy / agent / curriculum / level1.py View on Github external
"combine_terms_forced",
    [
        LessonExercise(
            lesson_name="needle_in_haystack",
            problem_count=4,
            problem_fn=lambda: combine_terms_in_place(),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=250,
            max_turns=2,
            num_observations=128,
        )
    ],
)


lesson_plan = build_lesson_plan(
    "combine_like_terms_1",
    [
        # LessonExercise(
        #     lesson_name="two_terms",
        #     problem_count=4,
        #     problem_fn=lambda: simplify_multiple_terms(2),
        #     problem_type=MODE_SIMPLIFY_POLYNOMIAL,
        #     mcts_sims=250,
        #     num_observations=64,
        # ),
        LessonExercise(
            lesson_name="needle_in_haystack",
            problem_count=4,
            problem_fn=lambda: combine_terms_in_place(),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=500,
github justindujardin / mathy / mathy / agent / curriculum / combine_like_terms_2.py View on Github external
return combine_multiple_like_add_terms(3)


def four_variable_terms():
    return combine_multiple_like_add_terms(4)


def five_variable_terms():
    return combine_multiple_like_add_terms(5)


def six_variable_terms():
    return combine_multiple_like_add_terms(6)


lessons = build_lesson_plan(
    "Combine Like Terms",
    [
        # LessonExercise(
        #     lesson_name="Two terms",
        #     num_exploration_moves=1,
        #     problem_count=100,
        #     problem_fn=two_variable_terms,
        #     problem_type=MODE_SIMPLIFY_POLYNOMIAL,
        #     max_turns=7,
        #     mcts_sims=250,
        # ),
        # LessonExercise(
        #     lesson_name="Two variable terms separated by a constant",
        #     problem_count=100,
        #     num_exploration_moves=3,
        #     problem_fn=two_variable_terms,
github justindujardin / mathy / mathy / agent / curriculum / level1.py View on Github external
)
    return problem, complexity


def move_around_interleaved_like_terms(number_terms, number_pairs):
    # interleaved multiple like variables: "4x + 2y + 6x + 3y"
    complexity = number_terms * number_pairs
    terms = []
    rand_vars = get_rand_vars(number_terms)
    for i in range(number_pairs):
        for j in range(number_terms):
            terms.append("{}{}".format(maybe_int(), rand_vars[j]))
    return " + ".join(terms), complexity


quick_test_plan = build_lesson_plan(
    "dev_test",
    [
        LessonExercise(
            lesson_name="two_terms",
            problem_count=2,
            problem_fn=lambda: simplify_multiple_terms(2),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=50,
        ),
        LessonExercise(
            lesson_name="three_terms",
            problem_count=4,
            problem_fn=lambda: simplify_multiple_terms(3),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=50,
        ),
github justindujardin / mathy / mathy / agent / curriculum / combine_like_terms.py View on Github external
return combine_multiple_like_add_terms(3)


def four_variable_terms():
    return combine_multiple_like_add_terms(4)


def five_variable_terms():
    return combine_multiple_like_add_terms(5)


def six_variable_terms():
    return combine_multiple_like_add_terms(6)


lessons = build_lesson_plan(
    "Combine Like Terms",
    [
        # LessonExercise(
        #     lesson_name="Two terms",
        #     problem_count=200,
        #     problem_fn=two_variable_terms,
        #     problem_type=MODE_SIMPLIFY_POLYNOMIAL,
        #     max_turns=7,
            # num_exploration_moves=20,
        #     mcts_sims=250,
        # ),
        # LessonExercise(
        #     lesson_name="Three variable terms",
        #     problem_count=100,
        #     problem_fn=three_variable_terms,
        #     problem_type=MODE_SIMPLIFY_POLYNOMIAL,
github justindujardin / mathy / mathy / agent / curriculum / level1 / white_belt.py View on Github external
max_turns=2,
            num_observations=white_belt_observations,
            moves_per_complexity=moves_per_complexity,
        ),
        LessonExercise(
            lesson_name="five_terms",
            problem_fn=lambda: simplify_multiple_terms(5),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=200,
            num_observations=white_belt_observations,
            moves_per_complexity=moves_per_complexity,
        ),
    ],
)

white_belt_practice = build_lesson_plan(
    "white_belt_practice",
    [
        LessonExercise(
            lesson_name="three_terms",
            problem_fn=lambda: simplify_multiple_terms(3),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=500,
            num_observations=white_belt_observations,
            moves_per_complexity=moves_per_complexity,
        ),
        LessonExercise(
            lesson_name="move_then_combine",
            problem_fn=lambda: combine_terms_after_commuting(4, 8),
            problem_type=MODE_SIMPLIFY_POLYNOMIAL,
            mcts_sims=500,
            max_turns=4,