Skip to content

Sourcery refactored master branch#1

Open
sourcery-ai[bot] wants to merge 1 commit into
masterfrom
sourcery/master
Open

Sourcery refactored master branch#1
sourcery-ai[bot] wants to merge 1 commit into
masterfrom
sourcery/master

Conversation

@sourcery-ai
Copy link
Copy Markdown

@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
Comment thread dcgan/model.py
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
Copy Markdown
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 thread dcgan/model.py
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
Copy Markdown
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:

Comment thread extra/charnn/test.py
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
Copy Markdown
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 thread extra/charnn/test.py
Comment on lines -23 to +22
samples = [c for c in prime]
samples = list(prime)
Copy link
Copy Markdown
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 thread extra/charnn/train.py
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
Copy Markdown
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 thread resnet/model.py
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
Copy Markdown
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.

0 participants