Skip to content

Commit

Permalink
Ya se solucionará el lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlota de la Vega committed May 14, 2024
1 parent 92bbbdc commit 03d52db
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

from cGAN import conditionalGAN

BATCH_SIZE = 64
NUM_CHANNELS = 1
NUM_CLASSES = 10
IMAGE_SIZE = 28
LATENT_DIM = 128
batch_size = 64
num_channels = 1
num_classes = 10
image_size = 28
latent_dim = 128


def load_dataset():
Expand All @@ -28,7 +28,7 @@ def load_dataset():
all_labels = keras.utils.to_categorical(all_labels, 10)

dataset = tf.data.Dataset.from_tensor_slices((all_digits, all_labels))
dataset = dataset.shuffle(buffer_size=1024).batch(BATCH_SIZE)
dataset = dataset.shuffle(buffer_size=1024).batch(batch_size)

return dataset

Expand All @@ -42,8 +42,8 @@ def build_models():
keras.Model: Discriminator model.
"""
# - - - - - - - Calculate the number of input channels - - - - - - -
gen_channels = LATENT_DIM + NUM_CLASSES
dis_channels = NUM_CHANNELS + NUM_CLASSES
gen_channels = latent_dim + num_classes
dis_channels = num_channels + num_classes

# - - - - - - - Generator - - - - - - -
generator = keras.Sequential(
Expand All @@ -55,7 +55,7 @@ def build_models():
keras.layers.Conv2DTranspose(128, kernel_size=4, strides=2, padding="same"),
keras.layers.LeakyReLU(negative_slope=0.2),
keras.layers.Conv2DTranspose(
BATCH_SIZE, kernel_size=4, strides=2, padding="same"
batch_size, kernel_size=4, strides=2, padding="same"
),
keras.layers.LeakyReLU(negative_slope=0.2),
keras.layers.Conv2DTranspose(
Expand All @@ -69,7 +69,7 @@ def build_models():
discriminator = keras.Sequential(
[
keras.layers.InputLayer((28, 28, dis_channels)),
keras.layers.Conv2D(BATCH_SIZE, kernel_size=3, strides=2, padding="same"),
keras.layers.Conv2D(batch_size, kernel_size=3, strides=2, padding="same"),
keras.layers.LeakyReLU(negative_slope=0.2),
keras.layers.Conv2D(128, kernel_size=3, strides=2, padding="same"),
keras.layers.LeakyReLU(negative_slope=0.2),
Expand All @@ -96,9 +96,9 @@ def build_conditional_gan(generator, discriminator):
cond_gan = conditionalGAN(
discriminator=discriminator,
generator=generator,
latent_dim=LATENT_DIM,
image_size=IMAGE_SIZE,
num_classes=NUM_CLASSES,
latent_dim=latent_dim,
image_size=image_size,
num_classes=num_classes,
)
cond_gan.compile(
d_optimizer=keras.optimizers.Adam(learning_rate=0.0003),
Expand Down

0 comments on commit 03d52db

Please sign in to comment.