Skip to content

Commit

Permalink
GAN with softmax also.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ragav Venkatesan committed Mar 5, 2017
1 parent 34f2ed8 commit fb68da9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pantry/tutorials/gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def deep_gan (dataset, verbose = 1 ):
verbose = verbose
)

"""

#C(D(x)) - This is the opposite of C(D(G(z))), real
net.add_layer ( type = "classifier",
id = "softmax",
Expand All @@ -442,7 +442,7 @@ def deep_gan (dataset, verbose = 1 ):
activation = 'softmax',
verbose = verbose
)
"""

# objective layers
# discriminator objective
net.add_layer (type = "tensor",
Expand Down Expand Up @@ -474,7 +474,7 @@ def deep_gan (dataset, verbose = 1 ):
datastream_origin = 'data',
verbose = verbose
)
"""

#softmax objective.
net.add_layer ( type = "objective",
id = "classifier_obj",
Expand All @@ -484,17 +484,17 @@ def deep_gan (dataset, verbose = 1 ):
datastream_origin = 'data',
verbose = verbose
)
"""

# from yann.utils.graph import draw_network
# draw_network(net.graph, filename = 'gan.png')
net.pretty_print()

net.cook ( objective_layers = [None, "discriminator_obj", "generator_obj"],
net.cook ( objective_layers = ["classifier_obj", "discriminator_obj", "generator_obj"],
optimizer_params = optimizer_params,
discriminator_layers = ["D1-x","D2-x"],
generator_layers = ["G1","G2","G(z)"],
# classifier_layers = ["D1-x","D2-x","softmax"],
# softmax_layer = "softmax",
classifier_layers = ["D1-x","D2-x","softmax"],
softmax_layer = "softmax",
game_layers = ("D(x)", "D(G(z))"),
verbose = verbose )

Expand Down

0 comments on commit fb68da9

Please sign in to comment.