Skip to content

Commit

Permalink
Still making another small cleanup on package.
Browse files Browse the repository at this point in the history
  • Loading branch information
gugarosa committed Apr 20, 2021
1 parent 3d2e401 commit bd87368
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions nalp/datasets/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ def _preprocess(self, images, shape, normalize):
"""

# Makes sure that images are float typed
images = images.astype('float32')

# If a shape is supplied
if shape:
# Reshapes the array and make sure that it is float typed
images = images.reshape(shape).astype('float32')

# If no shape is supplied
else:
# Just make sure that the array is float typed
images = images.astype('float32')
# Reshapes the array
images = images.reshape(shape)

# If images should be normalized
if normalize:
Expand Down
2 changes: 1 addition & 1 deletion nalp/models/dcgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, input_shape=(28, 28, 1), noise_dim=100, n_samplings=3, alpha=
super(DCGAN, self).__init__(D, G, name='dcgan')

logger.debug('Input: %s | Noise: %d | Number of samplings: %d | '
'Activation rate: %s | Dropout rate: %s',
'Activation rate: %s | Dropout rate: %s.',
input_shape, noise_dim, n_samplings,
alpha, dropout_rate)
logger.info('Class overrided.')
2 changes: 1 addition & 1 deletion nalp/models/generators/stacked_rnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, encoder=None, vocab_size=1, embedding_size=32, hidden_size=(6
# Creates the linear (Dense) layer
self.linear = Dense(vocab_size, name='out')

logger.debug('Number of cells: %d', len(hidden_size))
logger.debug('Number of cells: %d.', len(hidden_size))
logger.info('Class overrided.')

@property
Expand Down

0 comments on commit bd87368

Please sign in to comment.