-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Thanks a lot for doing this. I might misunderstand something, but l can understand how the gate update when training. I can not understand the two code...
gate = K.variable(1, dtype="uint8")
add_tables += [{"death_rate": _death_rate, "gate": gate}]
return Lambda(lambda tensors: K.switch(gate, tensors[0], tensors[1]),
output_shape=output_shape)([out, x])
Is this 'gate' always equal 1,when training ?...
class GatesUpdate(Callback):
def on_batch_begin(self, batch, logs={}):
open_all_gates()
rands = np.random.uniform(size=len(add_tables))
for t, rand in zip(add_tables, rands):
if rand < K.get_value(t["death_rate"]):
K.set_value(t["gate"], 0)
Is this 'GatesUpdate' make action on the 'Lambda' layer ,when training?
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels