Exemplo n.º 1
0
    def _visualize(self, info, logger):

        N = 16

        real = info.real[:N // 2]
        logger.add('images', 'real-img', util.image_size_limiter(real))

        gen = info.gen[:N]
        logger.add('images', 'gen-img', util.image_size_limiter(gen))
Exemplo n.º 2
0
	def _visualize(self, info, records):
		
		settings = self._viz_settings
		if 'gen' in settings and isinstance(self.generator, learn.Visualizable):
			self.generator.visualize(info, records)
		if 'disc' in settings and isinstance(self.discriminator, learn.Visualizable):
			self.discriminator.visualize(info, records)
		
		if 'samples' in settings:
			N = 16
			
			real = info.real[:N // 2]
			records.log('images', 'real-img', util.image_size_limiter(real))
			
			gen = info.gen[:N]
			records.log('images', 'gen-img', util.image_size_limiter(gen))
Exemplo n.º 3
0
	def _visualize(self, info, records):
		settings = self._viz_settings
		super()._visualize(info, records)
		
		B, C, *other = info.original.size()
		N = min(B, 8)
		
		if len(other) and ('gen-prior' in self._viz_settings or not self.training):
			viz_gen = self.generate_prior(2 * N).view(2*N, C, *other)
			if 'force' in settings:
				viz_gen = viz_gen.sigmoid()
			records.log('images', 'gen-prior', util.image_size_limiter(viz_gen))
Exemplo n.º 4
0
	def _visualize(self, info, records):
		
		N = 8
		
		# real = torch.cat([info.real_A[:N], info.real_B[:N]])
		# logger.add('images', 'real-img', util.image_size_limiter(real))

		real_A = info.real_A[:N]
		records.log('images', 'real-img-A', util.image_size_limiter(real_A))

		real_B = info.real_B[:N]
		records.log('images', 'real-img-B', util.image_size_limiter(real_B))
		
		gen_A = info.fake_A[:N * 2]
		records.log('images', 'gen-img-A', util.image_size_limiter(gen_A))
		
		gen_B = info.fake_B[:N * 2]
		records.log('images', 'gen-img-B', util.image_size_limiter(gen_B))
		
		rec_A = info.recov_A[:N * 2]
		records.log('images', 'rec-img-A', util.image_size_limiter(rec_A))
		
		rec_B = info.recov_B[:N * 2]
		records.log('images', 'rec-img-B', util.image_size_limiter(rec_B))