File tree Expand file tree Collapse file tree
pearl/policy_learners/exploration_modules/contextual_bandits Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212import torch
1313from pearl .api .action import Action
14+ from pearl .api .action_space import ActionSpace
1415from pearl .api .state import SubjectiveState
1516from pearl .policy_learners .exploration_modules import ExplorationModule
1617from pearl .policy_learners .exploration_modules .common .score_exploration_base import (
@@ -114,16 +115,15 @@ def get_unnormalize_prob(
114115 """
115116 return torch .div (1.0 , action_num + self ._gamma * empirical_gaps )
116117
117- # pyre-fixme[14]: `act` overrides method defined in `ScoreExplorationBase`
118- # inconsistently.
119118 def get_scores (
120119 self ,
121120 subjective_state : SubjectiveState ,
122- action_space : DiscreteActionSpace ,
121+ action_space : ActionSpace ,
123122 values : torch .Tensor ,
124123 exploit_action : Action | None = None ,
125124 representation : torch .nn .Module | None = None ,
126125 ) -> Action :
126+ assert isinstance (action_space , DiscreteActionSpace )
127127 return values .view (- 1 , action_space .n )
128128
129129 def compare (self , other : ExplorationModule ) -> str :
You can’t perform that action at this time.
0 commit comments