예제 #1
0
 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()
예제 #2
0
 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 __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)
예제 #5
0
 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()
예제 #6
0
 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)
예제 #7
0
 def test_height(self):
     with self.test_session():
         gan = BaseGAN(inputs=MockInput())
         self.assertEqual(gan.height(), 32)
예제 #8
0
 def test_batch_size(self):
     with self.test_session():
         gan = BaseGAN(inputs=MockInput(batch_size=1))
         self.assertEqual(gan.batch_size(), 1)
예제 #9
0
 def test_has_input(self):
     with self.test_session():
         inputs = MockInput()
         gan = BaseGAN(inputs=inputs)
         self.assertEqual(gan.inputs.x, inputs.x)
예제 #10
0
 def test_height(self):
     with self.test_session():
         gan = BaseGAN(inputs = MockInput())
         self.assertEqual(gan.height(), 32)
예제 #11
0
 def __init__(self, *args, **kwargs):
     self.frames = kwargs.pop('frames')
     BaseGAN.__init__(self, *args, **kwargs)
예제 #12
0
 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)
예제 #13
0
 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)
예제 #14
0
 def __init__(self, *args, **kwargs):
     BaseGAN.__init__(self, *args, **kwargs)
     self.x = self.inputs.next()
예제 #15
0
 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)
예제 #16
0
 def test_constructor(self):
     with self.test_session():
         gan = BaseGAN(inputs=MockInput())
         self.assertNotEqual(gan.config.description, None)
예제 #17
0
 def __init__(self, *args, **kwargs):
     BaseGAN.__init__(self, *args, **kwargs)
예제 #18
0
 def test_batch_size(self):
     with self.test_session():
         gan = BaseGAN(inputs = MockInput(batch_size = 1))
         self.assertEqual(gan.batch_size(), 1)