Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix #184

Merged
merged 7 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor
  • Loading branch information
maypink committed Aug 15, 2023
commit 29640f5e6ce747d9780dbc4e185de91fbaacf1dc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ContextualMultiArmedBanditAgent(OperatorAgent):
"""

def __init__(self, actions: Sequence[ActType],
context_agent: Union[ContextAgentTypeEnum, Callable],
context_agent_type: Union[ContextAgentTypeEnum, Callable],
available_operations: List[str],
n_jobs: int = 1,
enable_logging: bool = True):
Expand All @@ -37,8 +37,8 @@ def __init__(self, actions: Sequence[ActType],
learning_policy=LearningPolicy.UCB1(alpha=1.25),
neighborhood_policy=NeighborhoodPolicy.Clusters(),
n_jobs=n_jobs)
self._context_agent = context_agent if isinstance(context_agent, Callable) else \
partial(ContextAgentsRepository.agent_class_by_id(context_agent),
self._context_agent = context_agent_type if isinstance(context_agent_type, Callable) else \
partial(ContextAgentsRepository.agent_class_by_id(context_agent_type),
available_operations=available_operations)
self._is_fitted = False

Expand Down
2 changes: 1 addition & 1 deletion golem/core/optimisers/genetic/operators/mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _init_operator_agent(graph_gen_params: GraphGenerationParams,
agent = ContextualMultiArmedBanditAgent(
actions=parameters.mutation_types,
context_agent_type=parameters.context_agent_type,
available_operations=graph_gen_params.node_factory.available_nodes,
available_operations=graph_gen_params.node_factory.get_all_available_operations(),
n_jobs=requirements.n_jobs)
elif kind == MutationAgentTypeEnum.neural_bandit:
agent = NeuralContextualMultiArmedBanditAgent(actions=parameters.mutation_types,
Expand Down