Commit 8ad9ef4c authored by Tommy Duc Luu's avatar Tommy Duc Luu
Browse files

Merge branch 'main' of https://gitlab.stud.idi.ntnu.no/baardshe/IDATT2900-45b into main


Former-commit-id: 9f6b2eefefd8d68dda0814f977f969c9c5e4bef7 [formerly 9aafb081]
Former-commit-id: 721c2cd074696191d9a3174271d0f8a6dd6f0d39
parents 43441d0e ad9f026b
import copy
import math
from tqdm import trange
import multiprocessing as mp
import numpy as np
import torch
......@@ -226,21 +225,4 @@ class ES:
self.writer.add_scalar("growth_loss/200", growth_loss[1], iteration)
save_image(torch.cat(pics, dim=0), '%s/pic/big%04d.png' % (self.logdir, iteration), nrow=1, padding=0)
save_model(self.net, self.logdir + "/models/model_" + str(iteration))
# if mean_fit > -0.003:
# logging.info("Training goal reached, exiting")
# break
def generate_graphic(self):
model = self.net
x_eval = tt(np.repeat(self.seed[None, ...], self.batch_size, 0))
pics = []
pics.append(to_rgb(x_eval).permute(0, 3, 1, 2))
for eval in range(40):
x_eval = model(x_eval)
if eval in [10, 20, 30, 39]: # frames to save img of
pics.append(to_rgb(x_eval).permute(0, 3, 1, 2))
save_image(torch.cat(pics, dim=0), '%s/graphic.png' % (self.logdir), nrow=len(pics), padding=0)
\ No newline at end of file
......@@ -2,7 +2,7 @@ INFO:root:
Arguments:
img: '🥕'
size: 15
logdir: 'interactive_CA/logs/15-ADAM-CARROT_08-05-2022_11-06-44'
logdir: 'interactive_CA/logs/15-ADAM-CARROT_08-05-2022_16-52-40'
load_model_path: 'final_models\\Adam\\NonSamplePools\\15-CARROT-train_05-05-2022_17-31-03\\models\\model_19500.pt'
n_channels: 16
hidden_size: 32
......
......@@ -2,7 +2,7 @@ INFO:root:
Arguments:
img: '🥕'
size: 15
logdir: 'interactive_CA/logs/15-ES-CARROT_08-05-2022_12-30-22'
logdir: 'interactive_CA/logs/15-ES-CARROT_08-05-2022_16-55-05'
load_model_path: 'final_models\\ES\\NonSamplePools\\15-CARROT-train_06-05-2022_11-06-58\\models\\model_1999000'
n_channels: 16
hidden_size: 32
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment