Skip to content

Commit 5cec9b0

Browse files
committed
clean
1 parent 1c4eb7e commit 5cec9b0

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

HRM/hrm.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ def __init__(
6666
num_tokens,
6767
reasoning_steps = 2, # N in the paper - the number of forward evals for the last network (highest hierarchy) above
6868
relative_period: int | tuple[int, ...] = 2, # the relative period for each network evaluation call to the one just previous - in the paper, they do 2 networks with a period of 2
69-
min_reasoning_steps_epsilon_prob = 0.5, # they stochastically choose the minimum segment from 2 .. max with this probability, and 1 step the rest of the time
70-
max_reasoning_steps = 10,
71-
act_loss_weight = 1.,
72-
discount_factor = 1.,
7369
ignore_index = -1,
7470
):
7571
super().__init__()
@@ -106,7 +102,7 @@ def __init__(
106102
if len(relative_period) == (self.num_networks - 1):
107103
relative_period = (1, *relative_period)
108104

109-
# for the paper, they did (low: 1, high: 2) -
105+
# for the paper, they did (low: 1, high: 2) - read as low evaluated every step, high evaluated every 2 steps
110106

111107
assert len(relative_period) == self.num_networks and relative_period[0] == 1
112108

@@ -123,22 +119,6 @@ def __init__(
123119

124120
self.to_pred = Linear(dim, num_tokens, bias = False)
125121

126-
# Q(continue|halt) for their adaptive computation time setup
127-
128-
self.discount_factor = discount_factor
129-
130-
self.act_loss_weight = act_loss_weight
131-
132-
self.min_reasoning_steps_epsilon_prob = min_reasoning_steps_epsilon_prob
133-
self.max_reasoning_steps = max_reasoning_steps
134-
135-
self.to_q_continue_halt = Sequential(
136-
Reduce('b n d -> b d', 'mean'),
137-
RMSNorm(dim),
138-
Linear(dim, 2, bias = False),
139-
Rearrange('... continue_halt -> continue_halt ...')
140-
)
141-
142122
# loss related
143123

144124
self.ignore_index = ignore_index

0 commit comments

Comments
 (0)