Beispiel #1
0
from dataset import *
from wgan import *
from generators import *
from critics import *

dataset = FacesData(img_size=64)
# dataset = MNISTData()

generator = ConvGenerator(img_size=dataset.img_size,
                          channels=dataset.channels)
critic = ConvCritic(img_size=dataset.img_size,
                    channels=dataset.channels)

wgan = WGAN(generator=generator,
            critic=critic,
            dataset=dataset,
            z_size=100)

wgan(batch_size=8, steps=100000, model_path=project_path.model_path)
Beispiel #2
0
from dataset import *
from wgan import *
from generators import *
from critics import *

dataset = PianoRollData(img_size=(16, 128))
# dataset = MNISTData()

generator = DCGANGenerator(img_size=dataset.img_size,
                           channels=dataset.channels,
                           prev_x=dataset.prev_x)
critic = DCGANCritic(img_size=dataset.img_size,
                     channels=dataset.channels,
                     image=dataset.x)

wgan = WGAN(generator=generator,
            critic=critic,
            dataset=dataset,
            epoches=100,
            z_size=100)

wgan(batch_size=64, model_path=project_path.model_path)
Beispiel #3
0
import wgan
import sys
import os

if (len(sys.argv) < 2):
    wgan = wgan.GAN()
    wgan(100000, 256, 1000)
elif (len(sys.argv) == 5):
    if (sys.argv[1] == "load"):
        model_name = sys.argv[2]
        x = int(sys.argv[3])
        y = int(sys.argv[4])
        model = os.path.join("models", model_name)
        wgan = wgan.GAN()
        wgan.generate(model, x, y)
elif (len(sys.argv) == 4):
    if (sys.argv[1] == "load"):
        model_name = sys.argv[2]
        x = int(sys.argv[3])
        model = os.path.join("models", model_name)
        wgan = wgan.GAN()
        wgan.generate(model, x, 0)