Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

import tensorflow as tf 

import numpy as np 

import hyperchamber as hc 

from hypergan.generators.common import * 

 

from .base_generator import BaseGenerator 

 

class FullyConnectedGenerator(BaseGenerator): 

 

def required(self): 

return [] 

 

def build(self, net): 

gan = self.gan 

ops = self.ops 

config = self.config 

activation = ops.lookup(config.activation or 'lrelu') 

 

print("[dcgan] NET IS", net) 

 

net = ops.linear(net, 1024) 

 

shape = ops.shape(net) 

x_shape = ops.shape(self.gan.inputs.x) 

output_size = x_shape[1]*x_shape[2]*x_shape[3] 

print("Output size", output_size) 

 

net = activation(net) 

net = ops.linear(net, 2*1024) 

net = activation(net) 

net = ops.linear(net, output_size) 

net = ops.lookup('tanh')(net) 

 

net = ops.reshape(net, output_size) 

 

self.sample = net 

return self.sample