Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Jul 26, 2023

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from theonesud July 26, 2023 13:33
def deconv(c_in, c_out, k_size, stride=2, pad=1, bn=True):
layers = []
layers.append(nn.ConvTranspose2d(c_in, c_out, k_size, stride, pad))
layers = [nn.ConvTranspose2d(c_in, c_out, k_size, stride, pad)]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function deconv refactored with the following changes:

Comment on lines -14 to +13
layers = []
layers.append(nn.Conv2d(c_in, c_out, k_size, stride, pad))
layers = [nn.Conv2d(c_in, c_out, k_size, stride, pad)]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function conv refactored with the following changes:

p = p / np.sum(p)
c = np.random.choice(vocab_size, 1, p=p)[0]
return c
return np.random.choice(vocab_size, 1, p=p)[0]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function pick_top_n refactored with the following changes:

Comment on lines -23 to +22
samples = [c for c in prime]
samples = list(prime)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function sample refactored with the following changes:

Comment on lines -73 to +82
print('Epoch: {} '.format(e + 1), 'Loss: {:.4f} '.format(batch_loss),
'{:.4f} sec/batch'.format((end - start)))
print(
f'Epoch: {e + 1} ',
'Loss: {:.4f} '.format(batch_loss),
'{:.4f} sec/batch'.format((end - start)),
)

if (counter % save_every_n == 0):
saver.save(sess, "saves/{}.ckpt".format(counter))
saver.save(sess, f"saves/{counter}.ckpt")

saver.save(sess, "saves/{}.ckpt".format(counter))
saver.save(sess, f"saves/{counter}.ckpt")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function train refactored with the following changes:

Comment on lines -52 to +54
layers = []
layers.append(
block(self.in_channels, out_channels, stride, downsample))
layers = [block(self.in_channels, out_channels, stride, downsample)]
self.in_channels = out_channels
for i in range(1, blocks):
layers.append(block(out_channels, out_channels))
layers.extend(block(out_channels, out_channels) for _ in range(1, blocks))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ResNet.make_layer refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant