From 60c6352843cb090890fe32b15045de871fb8327a Mon Sep 17 00:00:00 2001 From: James Betker Date: Mon, 6 Jul 2020 20:44:07 -0600 Subject: [PATCH] Misc --- codes/recover_tensorboard_log.py | 7 ++++--- codes/utils/numeric_stability.py | 15 ++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/codes/recover_tensorboard_log.py b/codes/recover_tensorboard_log.py index 1b30f8df..3deef011 100644 --- a/codes/recover_tensorboard_log.py +++ b/codes/recover_tensorboard_log.py @@ -1,12 +1,13 @@ from torch.utils.tensorboard import SummaryWriter if __name__ == "__main__": - writer = SummaryWriter("../experiments/train_div2k_feat_nsgen_r3/recovered_tb") - f = open("../experiments/train_div2k_feat_nsgen_r3/console.txt", encoding="utf8") + writer = SummaryWriter("../experiments/recovered_tb") + f = open("../experiments/recovered_tb.txt", encoding="utf8") console = f.readlines() search_terms = [ ("iter", ", iter: ", ", lr:"), - ("l_g_total", " l_g_total: ", " switch_temperature:") + ("l_g_total", " l_g_total: ", " switch_temperature:"), + ("l_d_fake", "l_d_fake: ", " D_fake:") ] iter = 0 for line in console: diff --git a/codes/utils/numeric_stability.py b/codes/utils/numeric_stability.py index 3e7855f9..b5645193 100644 --- a/codes/utils/numeric_stability.py +++ b/codes/utils/numeric_stability.py @@ -1,5 +1,6 @@ import torch from torch import nn +import models.archs.SRG1_arch as srg1 import models.archs.SwitchedResidualGenerator_arch as srg import models.archs.NestedSwitchGenerator as nsg import functools @@ -96,15 +97,15 @@ if __name__ == "__main__": torch.randn(1, 3, 64, 64), device='cuda') ''' - test_stability(functools.partial(srg.ConfigurableSwitchedResidualGenerator2, - switch_filters=[16,16,16,16,16], - switch_growths=[32,32,32,32,32], - switch_reductions=[1,1,1,1,1], - switch_processing_layers=[5,5,5,5,5], - trans_counts=[8,8,8,8,8], + test_stability(functools.partial(srg1.ConfigurableSwitchedResidualGenerator, + switch_filters=[32,32,32,32], + switch_growths=[16,16,16,16], + switch_reductions=[4,3,2,1], + switch_processing_layers=[3,3,4,5], + trans_counts=[16,16,16,16,16], trans_kernel_sizes=[3,3,3,3,3], trans_layers=[3,3,3,3,3], - transformation_filters=64, + trans_filters_mid=[24,24,24,24,24], initial_temp=10), torch.randn(1, 3, 64, 64), device='cuda')