Leap

Leap_problem

class gaggle.problem.leap.leap_problem.LeapProblem(leap_problem: Callable, problem_args: ProblemArgs = None, sys_args: SysArgs = None, *args, **kwargs)[source]

Bases: Problem

Wrapper for leap problems. Takes in a leap problem and allows it to be run within Gaggle’s framework.

evaluate(individual: Individual, *args, **kwargs) float[source]

Evaluate the given individual based on this problem.

Parameters:
  • individual – individual to be evaluated

  • train – whether this is a training or testing evaluation (matters for certain problems)

  • *args – additional args that would need to be passed to the individual forward function (call)

  • **kwargs – additional kwargs that would need to be passed to the individual forward function (call)

Returns: a float representing the individual’s fitness

class gaggle.problem.leap.leap_problem.RegistrableLeapProblem(leap_problem: Callable, *args, **kwargs)[source]

Bases: object

Constructor that returns its associated leap problem when called (wrapper for ProblemFactory).

gaggle.problem.leap.leap_problem.convert_leap_problem(leap_problem: Callable, *args, **kwargs)[source]