Exemplo n.º 1
0
    def __init__(self, port, frequency=10, name="Network Loss"):
        self.visdom = VisdomLinePlotter(port=port)
        self.frequency = frequency

        self.name = name

        self.epoch_loss = 0
Exemplo n.º 2
0
class EpochLog:
    def __init__(self, port, frequency=10, name="Network Loss"):
        self.visdom = VisdomLinePlotter(port=port)
        self.frequency = frequency

        self.name = name

    def message(self, epoch, loss):
        if epoch % self.frequency == 0:
            self.visdom.plot("Loss",
                             "Training Loss",
                             self.name,
                             epoch,
                             loss,
                             xlabel='epochs')
            print("Epoch {} loss: {}".format(epoch, loss))
Exemplo n.º 3
0
import argparse
import itertools
import PIL

from torch.utils.data import TensorDataset, DataLoader
from torchvision.datasets import ImageFolder
import torchvision.transforms as transforms

from plotting import VisdomLinePlotter
from model import Model, VGG16FeatureExtractor
from loss import Loss
import utils
import os
import json

plotter = VisdomLinePlotter()

parser = argparse.ArgumentParser(
    description=
    'An implementation of the 2018 Image Inpainting for Irregular Holes Using Partial Convolutions paper in PyTorch'
)

parser.add_argument('--datadir',
                    type=str,
                    default="images/train",
                    help='directory for training data')
parser.add_argument('--validdir',
                    type=str,
                    default="images/valid",
                    help='directory for validation data')
parser.add_argument('--maskdir',