Skip to content

Commit c5b5be5

Browse files
author
Ralf
committed
figure type in GAN learning progress plots
1 parent 7574a60 commit c5b5be5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

hicGAN.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def __init__(self, log_dir: str,
1818
tv_weight: float = 1e-10,
1919
input_size: int = 256,
2020
plot_frequency: int = 20,
21+
plot_type: str = "png",
2122
learning_rate: float = 2e-5,
2223
adam_beta_1: float = 0.5):
2324
super().__init__()
@@ -48,8 +49,11 @@ def __init__(self, log_dir: str,
4849
discriminator_optimizer=self.discriminator_optimizer,
4950
generator=self.generator,
5051
discriminator=self.discriminator)
51-
52-
self.progress_plot_name = os.path.join(self.log_dir, "lossOverEpochs.png")
52+
self.plot_type = plot_type
53+
if self.plot_type not in ["png", "pdf", "svg"]:
54+
self.plot_type = "png"
55+
print("plot type {:s} unsupported, changed to png".format(plot_type))
56+
self.progress_plot_name = os.path.join(self.log_dir, "lossOverEpochs.{:s}".format(self.plot_type))
5357
self.progress_plot_frequency = plot_frequency
5458
self.example_plot_frequency = 5
5559

training.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ def training(trainmatrices,
238238
tv_weight=lossweighttv,
239239
input_size=windowsize,
240240
learning_rate=learningrate,
241-
adam_beta_1=beta1)
241+
adam_beta_1=beta1,
242+
plot_type=figuretype)
242243
if pretrainedintromodel is not None:
243244
hicGanModel.loadIntroModel(trainedModelPath=pretrainedintromodel)
244245
hicGanModel.plotModels(outputpath=outfolder, figuretype=figuretype)

0 commit comments

Comments
 (0)