-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How the gate update , when training? #10
Comments
Sorry for messy code.
No. Its value will be changed in
Not |
Thank you for your reply.
Can you give me some advice? |
@DehuaTang ...
class GatesUpdate(Callback):
def on_batch_begin(self, batch, logs={}):
print("[ Batch %d ]" % batch) # added
open_all_gates()
rands = np.random.uniform(size=len(add_tables))
for i, (t, rand) in enumerate(zip(add_tables, rands)):
if rand < K.get_value(t["death_rate"]):
print("%d-th gate is closed", i) # added
K.set_value(t["gate"], 0)
else:
print("%d-th gate is open", i) # added
def on_batch_end(self, batch, logs={}):
open_all_gates() # for validation
... I'm sorry but I do not have time to answer more of your questions. |
Thank you for helping me solve the problem ! ! |
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...
Is this 'gate' always equal 1,when training ?...
Is this 'GatesUpdate' make action on the 'Lambda' layer ,when training?
Thank you.
The text was updated successfully, but these errors were encountered: