Skip to content

Commit

Permalink
trained 5k
Browse files Browse the repository at this point in the history
  • Loading branch information
RileyLazarou committed Sep 6, 2020
1 parent 24e267a commit c4da2ac
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 7 deletions.
26 changes: 19 additions & 7 deletions aegan.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import json
import sys
import time

import torch
from torch import nn
Expand Down Expand Up @@ -799,7 +800,6 @@ def save_images(GAN, vec, filename):

def main():
import matplotlib.pyplot as plt
from time import time
os.makedirs("results/generated", exist_ok=True)
os.makedirs("results/reconstructed", exist_ok=True)
os.makedirs("results/checkpoints", exist_ok=True)
Expand Down Expand Up @@ -848,17 +848,29 @@ def main():
batch_size=batch_size,
gen_path=gen_path,
)
start = time()
start = time.time()
for i in range(epochs):
print(f"Epoch {i+1}; Elapsed time = {int(time() - start)}s")
while True:
try:
with open("pause.json") as f:
pause = json.load(f)
if pause['pause'] == 0:
break
print(f"Pausing for {pause['pause']} seconds")
time.sleep(pause["pause"])
except (KeyError, json.decoder.JSONDecodeError, FileNotFoundError):
break
elapsed = int(time.time() - start)
elapsed = f"{elapsed // 3600:02d}:{(elapsed % 3600) // 60:02d}:{elapsed % 60:02d}"
print(f"Epoch {i+1}; Elapsed time = {elapsed}s")
gan.train_epoch(max_steps=100)
if (i + 1) % 50 == 0:
torch.save(gan.generator.state_dict(), f"results/checkpoints/check.{i:05d}.pt")
save_images(gan, test_noise, f"results/generated/gen.{i:04d}.png")
if (i+1) % 1000 == 0:
gan._init_encoder()
gan._init_dx()
gan._init_dz()
# if (i+1) % 1000 == 0:
# gan._init_encoder()
# gan._init_dx()
# gan._init_dz()

if not "encoder" in dir(gan):
continue
Expand Down
3 changes: 3 additions & 0 deletions pause.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pause": 0
}
Binary file renamed samples/check.04949.pt → samples/check.04899.pt
Binary file not shown.
Binary file modified samples/generated/gen.4890.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/generated/gen.4891.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/generated/gen.4892.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/generated/gen.4893.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/generated/gen.4894.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/generated/gen.4895.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/generated/gen.4896.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/generated/gen.4897.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/generated/gen.4898.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/generated/gen.4899.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/gen.4890.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/gen.4891.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/gen.4892.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/gen.4893.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/gen.4894.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/gen.4895.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/gen.4896.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/gen.4897.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/gen.4898.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/gen.4899.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/reconstructed/test_images.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c4da2ac

Please sign in to comment.