Skip to content

mathy.api

Mathy

Mathy(
    self,
    model_path: str = None,
    model: tensorflow.python.keras.engine.training.Model = None,
    config: Union[mathy.agent.config.AgentConfig, mathy.swarm.fragile.SwarmConfig] = None,
    silent: bool = False,
)
The standard interface for working with Mathy models and agents.

simplify_model

Mathy.simplify_model(
    self,
    model: str = 'mathy_alpha_sm',
    problem: str,
    max_steps: int,
) -> mathy.agent.episode_memory.EpisodeMemory
Simplify an input problem using the PolySimplify environment.

Arguments

  • model (str): The input model to use for picking simplifying actions
  • problem (str): The ascii math problem text, e.g. -(4 + 2x) * 8 / 7y^(3 - 2)
  • max_steps (int): The maximum number of episode steps to allow the agent to take while solving the problem. Taking more than this is considered a failure.

Returns

(EpisodeMemory): The stored episode memory containing the intermediate steps to get to the solution for the input problem.

MathyAPIModelState

MathyAPIModelState(
    self,
    config: mathy.agent.config.AgentConfig,
    model: tensorflow.python.keras.engine.training.Model,
) -> None
MathyAPIModelState(config:mathy.agent.config.AgentConfig, model:tensorflow.python.keras.engine.training.Model)

MathyAPISwarmState

MathyAPISwarmState(self, config:mathy.swarm.fragile.SwarmConfig) -> None
MathyAPISwarmState(config:mathy.swarm.fragile.SwarmConfig)


Last update: July 24, 2020