Skip to content

Commit

Permalink
softmax_actions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjuncheng committed Jan 24, 2019
1 parent 2e0246f commit 29ea649
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rl_portfolio_management/wrappers/softmax_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ class SoftmaxActions(gym.Wrapper):

def step(self, action):
# also it puts it in a list
# print('action in softmax', type(action))
if isinstance(action, list):
action = action[0]
# action = action[0]
# Junchen: change to fit new Horizon framework
action = action

if isinstance(action, dict):
action = list(action[k] for k in sorted(action.keys()))

action = softmax(action, t=1)
# print('action in softmax after', action.shape)

return self.env.step(action)

0 comments on commit 29ea649

Please sign in to comment.