def __init__(self, *args, **kwargs): self.discriminator = None self.generator = None self.loss = None self.trainer = None BaseGAN.__init__(self, *args, **kwargs) self.x, self.y = self.inputs.next()
def test_create_component(self): with self.test_session(): gan = BaseGAN(inputs=MockInput()) distribution = gan.create_component(gan.config.distribution) self.assertEqual( type(distribution), hg.distributions.uniform_distribution.UniformDistribution)
def __init__(self, latent=None, x=None, *args, **kwargs): self.discriminator = None self.latent = None self.generator = None self.loss = None self.trainer = None self.session = None self.latent = latent self.x = x BaseGAN.__init__(self, *args, **kwargs)
def test_create(self): with self.test_session(): gan = BaseGAN(inputs=MockInput()) gan.create() self.assertEqual(gan.created, True) with self.assertRaises(ValidationException): gan.create()
def test_get_config_value(self): with self.test_session(): gan = BaseGAN(inputs=MockInput()) self.assertEqual(type(gan.get_config_value('generator')), hc.config.Config) self.assertEqual(gan.get_config_value('missing'), None)
def test_height(self): with self.test_session(): gan = BaseGAN(inputs=MockInput()) self.assertEqual(gan.height(), 32)
def test_batch_size(self): with self.test_session(): gan = BaseGAN(inputs=MockInput(batch_size=1)) self.assertEqual(gan.batch_size(), 1)
def test_has_input(self): with self.test_session(): inputs = MockInput() gan = BaseGAN(inputs=inputs) self.assertEqual(gan.inputs.x, inputs.x)
def test_height(self): with self.test_session(): gan = BaseGAN(inputs = MockInput()) self.assertEqual(gan.height(), 32)
def __init__(self, *args, **kwargs): self.frames = kwargs.pop('frames') BaseGAN.__init__(self, *args, **kwargs)
def test_create_component(self): with self.test_session(): gan = BaseGAN(inputs=MockInput()) encoder = gan.create_component(gan.config.encoder) self.assertEqual(type(encoder), hg.encoders.uniform_encoder.UniformEncoder)
def __init__(self, *args, **kwargs): self.per_sample_frames = 3 self.frames = kwargs.pop('frames') self.per_sample_frames = kwargs.pop('per_sample_frames') BaseGAN.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): BaseGAN.__init__(self, *args, **kwargs) self.x = self.inputs.next()
def test_get_config_value(self): with self.test_session(): gan = BaseGAN(inputs = MockInput()) self.assertEqual(type(gan.get_config_value('generator')), hc.config.Config) self.assertEqual(gan.get_config_value('missing'), None)
def test_constructor(self): with self.test_session(): gan = BaseGAN(inputs=MockInput()) self.assertNotEqual(gan.config.description, None)
def __init__(self, *args, **kwargs): BaseGAN.__init__(self, *args, **kwargs)
def test_batch_size(self): with self.test_session(): gan = BaseGAN(inputs = MockInput(batch_size = 1)) self.assertEqual(gan.batch_size(), 1)