ConditionalGenerativeAdversarialNetwork uses two neural networks to generate new contents from noise.
The Generator and Discriminator models must be created separately. Then use setGeneratorModel() and setDiscriminatorModel() to put it inside the ConditionalGenerativeAdversarialNetwork model.
Generator and Discriminator models must be a part of NeuralNetwork model. If you decide to use linear regression or logistic regression, then it must be constructed using NeuralNetwork model.
Ensure the output layer of the Discriminator model has only one neuron and its activation function set to “Sigmoid”. It is the default setting for all Discriminator models in research papers.
The number of neurons at the Generator’s input layer must be equal to the total the number of neurons at the Discriminator’s output layer and the number of features in label matrix.
It is recommended that the learning rate for the Generator is higher than the Discriminator.
Create new model object. If any of the arguments are nil, default argument values for that argument will be used.
ConditionalGenerativeAdversarialNetwork.new(maximumNumberOfIterations: number): ModelObject
Set model’s parameters. When any of the arguments are nil, previous argument values for that argument will be used.
ConditionalGenerativeAdversarialNetwork:setParameters(maximumNumberOfIterations: number)
Sets the Generator into the model.
ConditionalGenerativeAdversarialNetwork:setGeneratorModel(GeneratorModel: Model)
Sets the Discriminator into the model.
ConditionalGenerativeAdversarialNetwork:setDiscriminatorModel(DiscriminatorModel: Model)
Gets the Generator from the model.
WassersteinGenerativeAdversarialNetwork:getGeneratorModel(): Model
Gets the Discriminator from the model.
WassersteinGenerativeAdversarialNetwork:getDiscriminatorModel(): Model
Trains the model.
ConditionalGenerativeAdversarialNetwork:train(realFeatureMatrix: matrix, noiseFeatureMatrix: matrix, labelMatrix: matrix)
realFeatureMatrix: The matrix containing the features of the real contents. The number of columns must be equal to number of neurons at the output layer of the Generator.
noiseFeatureMatrix: The matrix containing the noise in order to generate fake contents. The number of columns must be equal to number of neurons at the input layer of the Generator.
labelMatrix: The matrix containing the class labels corresponding to the real feature matrix.
Generates the output from Discriminator.
ConditionalGenerativeAdversarialNetwork:evaluate(featureMatrix: matrix, labelMatrix: matrix): matrix
featureMatrix: The matrix containing all data.
labelMatrix: The matrix containing the class labels corresponding to the feature matrix.
Generates the output from Generator.
ConditionalGenerativeAdversarialNetwork:generate(noiseFeatureMatrix: matrix, labelMatrix: matrix): matrix
noiseFeatureMatrix: The matrix containing the noise in order to generate fake contents. The number of columns must be equal to number of neurons at the input layer of the Generator.
labelMatrix: The matrix containing the class labels corresponding to the real feature matrix.