Skip to content
Snippets Groups Projects
Commit 3e852835 authored by Yandi's avatar Yandi
Browse files

non-vanishing RNN

parent 9767cada
No related branches found
No related tags found
1 merge request!1Master into main
...@@ -56,8 +56,8 @@ BidirectionalLSTM: ...@@ -56,8 +56,8 @@ BidirectionalLSTM:
RNN: RNN:
HiddenSize: 35 HiddenSize: 35
NumLayers: 4 NumLayers: 2
NumFFN: 15 NumFFN: 2
Dropout: 0.2 Dropout: 0.2
Initialization: None Initialization: None
......
No preview for this file type
...@@ -120,14 +120,14 @@ if __name__ == "__main__": ...@@ -120,14 +120,14 @@ if __name__ == "__main__":
wandb.watch(network, log_freq = log_freq) wandb.watch(network, log_freq = log_freq)
for t in range(cfg["Training"]["Epochs"]): for t in range(cfg["Training"]["Epochs"]):
logging.info("Epoch {}".format(t)) print("Epoch {}".format(t))
train(args, network, train_loader, f_loss, optimizer, device, log_interval) train(args, network, train_loader, f_loss, optimizer, device, log_interval)
val_loss = test.test(network, valid_loader, f_loss, device) val_loss = test.test(network, valid_loader, f_loss, device)
network_checkpoint.update(val_loss) network_checkpoint.update(val_loss)
logging.info(" Validation : Loss : {:.4f}".format(val_loss)) print(" Validation : Loss : {:.4f}".format(val_loss))
if not args.no_wandb: if not args.no_wandb:
wandb.log({"val_loss": val_loss}) wandb.log({"val_loss": val_loss})
......
...@@ -35,6 +35,10 @@ def test(model, loader, f_loss, device): ...@@ -35,6 +35,10 @@ def test(model, loader, f_loss, device):
# Compute the forward pass, i.e. the scores for each input image # Compute the forward pass, i.e. the scores for each input image
outputs = model(inputs) outputs = model(inputs)
print("Validation inputs :")
print(inputs)
print("Validation outputs :")
print(outputs)
# We accumulate the exact number of processed samples # We accumulate the exact number of processed samples
N += inputs.shape[0] N += inputs.shape[0]
......
No preview for this file type
No preview for this file type
run-20230203_215737-zxchwf43/logs/debug-internal.log run-20230203_233455-ujner2cx/logs/debug-internal.log
\ No newline at end of file \ No newline at end of file
run-20230203_215737-zxchwf43/logs/debug.log run-20230203_233455-ujner2cx/logs/debug.log
\ No newline at end of file \ No newline at end of file
run-20230203_215737-zxchwf43 run-20230203_233455-ujner2cx
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment