{"action":"opened","issue":{"url":"https://api.github.com/repos/eriklindernoren/Keras-GAN/issues/40","repository_url":"https://api.github.com/repos/eriklindernoren/Keras-GAN","labels_url":"https://api.github.com/repos/eriklindernoren/Keras-GAN/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/eriklindernoren/Keras-GAN/issues/40/comments","events_url":"https://api.github.com/repos/eriklindernoren/Keras-GAN/issues/40/events","html_url":"https://github.com/eriklindernoren/Keras-GAN/issues/40","id":324595035,"number":40,"title":"AAE Model - Encoder Output - Training Order","user":{"login":"pGit1","id":13975114,"avatar_url":"https://avatars0.githubusercontent.com/u/13975114?v=4","gravatar_id":"","url":"https://api.github.com/users/pGit1","html_url":"https://github.com/pGit1","followers_url":"https://api.github.com/users/pGit1/followers","following_url":"https://api.github.com/users/pGit1/following{/other_user}","gists_url":"https://api.github.com/users/pGit1/gists{/gist_id}","starred_url":"https://api.github.com/users/pGit1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pGit1/subscriptions","organizations_url":"https://api.github.com/users/pGit1/orgs","repos_url":"https://api.github.com/users/pGit1/repos","events_url":"https://api.github.com/users/pGit1/events{/privacy}","received_events_url":"https://api.github.com/users/pGit1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-19T02:46:54Z","updated_at":"2018-05-19T02:46:54Z","closed_at":null,"author_association":"NONE","body":"@eriklindernoren as always thank you for the amazing library!\r\n\r\nCan you explain what this code is doing here for the encoder starting from the variable \"mu\"? Im not sure which model this corresponds to in the paper. Are you doing this merge layer as \"hack\" to make the latent code closer to normal to make training easier on the network? \r\n\r\nReally curious on your interpretation of the merge layer...This seems like a good trick but I want to make sure I understand what is going on and the why behind it. \r\n\r\n```\r\n    def build_encoder(self):\r\n        # Encoder\r\n\r\n        img = Input(shape=self.img_shape)\r\n\r\n        h = Flatten()(img)\r\n        h = Dense(512)(h)\r\n        h = LeakyReLU(alpha=0.2)(h)\r\n        h = Dense(512)(h)\r\n        h = LeakyReLU(alpha=0.2)(h)\r\n        mu = Dense(self.latent_dim)(h)\r\n        log_var = Dense(self.latent_dim)(h)\r\n        latent_repr = merge([mu, log_var],\r\n                mode=lambda p: p[0] + K.random_normal(K.shape(p[0])) * K.exp(p[1] / 2),\r\n                output_shape=lambda p: p[0])\r\n\r\n         return Model(img, latent_repr)\r\n```\r\n\r\nConcerning the training loop code I notice you do like the below when training the discrminator, but does this adversely affect performance? Isn't it better to feeds nets data randomly (e.g. send a minbatch with both positives and negatives in it and do train_on_batch once)?\r\n\r\n```\r\n            # Train the discriminator\r\n            d_loss_real = self.discriminator.train_on_batch(latent_real, valid)\r\n            d_loss_fake = self.discriminator.train_on_batch(latent_fake, fake)\r\n            d_loss = 0.5 * np.add(d_loss_real, d_loss_fake)\r\n```\r\n\r\nCan you explain you rationale for this type of setup? Im **NOT** questioning your methods, just trying to understand."}}
{"actor":{"display_login":"pGit1"}}