This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Title</title> | |
<body> | |
<center> | |
<h2>Welcome to my new website</h2> | |
<iframe id = "new" src="http://www.cnn.com" style="opacity:0.0;position:absolute;top:195px;left:10px;width:1000px;height:200px"> | |
</iframe> | |
</center> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trained_model.eval() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load the saved checkpoint | |
model, optimizer, start_epoch, valid_loss_min = load_ckp(ckp_path, model, optimizer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%ls ./checkpoint/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%ls ./best_model/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
checkpoint = { | |
'epoch': epoch + 1, | |
'valid_loss_min': valid_loss, | |
'state_dict': model.state_dict(), | |
'optimizer': optimizer.state_dict(), | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trained_model = train(start_epoch, 6, valid_loss_min, loaders, model, optimizer, criterion, use_cuda, "./checkpoint/current_checkpoint.pt", "./best_model/best_model.pt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("model = ", model) | |
print("optimizer = ", optimizer) | |
print("start_epoch = ", start_epoch) | |
print("valid_loss_min = ", valid_loss_min) | |
print("valid_loss_min = {:.6f}".format(valid_loss_min)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define optimzer | |
optimizer = optim.Adam(model.parameters(), lr=0.001) | |
# define checkpoint saved path | |
ckp_path = "./checkpoint/current_checkpoint.pt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model = FashionClassifier() | |
# move model to GPU if CUDA is available | |
if use_cuda: | |
model = model.cuda() | |
print(model) |
NewerOlder