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

Add loss factor to CostControlBandit and update logic for dynamic subsidy factor #65

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

shaharbar1
Copy link
Collaborator

Changes:

  • Added update of subsidy factor on MAB update step.
  • Added option to allow Beta regime for subsidy factor and added convex combination loss function for determining best action over feasible set.
  • Edited MultiObjectiveCostControlBandit on strategy.py to generalize CostControlBandit.
  • Edited Base MAB, sMAB, and cMAB classes in mab.py, smab.py, and cmab.py, respectively to reduce duplicated code.
  • Added test suite to support the new dynamic CC functionality.

@shaharbar1 shaharbar1 force-pushed the feature/dynamic_cost_subsidy branch 2 times, most recently from 80be396 to 7356cf2 Compare October 14, 2024 06:52
@shaharbar1 shaharbar1 added the enhancement New feature or request label Oct 14, 2024
@shaharbar1 shaharbar1 force-pushed the feature/dynamic_cost_subsidy branch 2 times, most recently from efdc3c2 to ce6749a Compare October 14, 2024 08:20
…sidy factor

### Changes:
* Added update of subsidy factor on MAB update step.
* Added option to allow Beta regime for subsidy factor and added convex combination loss function for determining best action over feasible set.
* Edited MultiObjectiveCostControlBandit on strategy.py to generalize CostControlBandit.
* Edited Base MAB, sMAB, and cMAB classes in mab.py, smab.py, and cmab.py, respectively to reduce duplicated code.
* Added test suite to support the new dynamic CC functionality.
@shaharbar1 shaharbar1 force-pushed the feature/dynamic_cost_subsidy branch from ce6749a to 1f2dae3 Compare October 31, 2024 08:05
@@ -39,14 +39,13 @@ class DummyMab(BaseMab):
epsilon: Optional[Float01] = None
default_action: Optional[ActionId] = None

def update(self, actions: List[ActionId], rewards: Union[List[BinaryReward], List[List[BinaryReward]]]):
self._validate_update_params(actions=actions, rewards=rewards)
def _update(self, actions: List[ActionId], rewards: Union[List[BinaryReward], List[List[BinaryReward]]]):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type would benefit of being simplified in something like

type BinaryRewards = List[BinaryReward]

def _update(...): List[BinaryReward] | List[BinaryRewards]

@@ -182,10 +181,27 @@ def update(
rewards: List[Union[BinaryReward, List[BinaryReward]]]
The reward for each sample.
"""
self._validate_update_params(actions=actions, rewards=rewards)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This side effect should be a function decorator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants