Skip to content

Sourcery refactored master branch#1

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

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

Conversation

@sourcery-ai
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot commented Jul 12, 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 vsedov July 12, 2023 09:16
This program tries to predict the number of thefts from
the number of fire in the city of Chicago
"""

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.

Lines 41-53 refactored with the following changes:

This removes the following comments ( why? ):

# TO DO: write sess.run()
# Session runs optimizer to minimize loss and fetch the value of loss

MNIST dataset: yann.lecun.com/exdb/mnist/

"""

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.

Lines 29-84 refactored with the following changes:

MNIST dataset: yann.lecun.com/exdb/mnist/

"""

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.

Lines 57-84 refactored with the following changes:

Comment thread 02_queue_example.py
Author: Chip Huyen
Prepared for O'Reilly "A short course in TensorFlow"
"""

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.

Lines 17-35 refactored with the following changes:

This removes the following comments ( why? ):

# do to 100 iterations

Comment thread 02_tfrecord_example.py
Comment on lines -84 to +89
# assume the image has the label Chihuahua, which corresponds to class number 1
label = 1
image_file = IMAGE_PATH + 'friday.jpg'
tfrecord_file = IMAGE_PATH + 'friday.tfrecord'
write_tfrecord(label, image_file, tfrecord_file)
read_tfrecord(tfrecord_file)
# assume the image has the label Chihuahua, which corresponds to class number 1
label = 1
image_file = f'{IMAGE_PATH}friday.jpg'
tfrecord_file = f'{IMAGE_PATH}friday.tfrecord'
write_tfrecord(label, image_file, tfrecord_file)
read_tfrecord(tfrecord_file)
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 main refactored with the following changes:

Comment thread 02_word2vec_visualize.py
Comment on lines -110 to +112
writer = tf.summary.FileWriter('improved_graph/lr' + str(LEARNING_RATE), sess.graph)
writer = tf.summary.FileWriter(
f'improved_graph/lr{str(LEARNING_RATE)}', sess.graph
)
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_model refactored with the following changes:

Comment thread process_data.py
Comment on lines -33 to +35
raise Exception('File ' + file_name +
' might be corrupted. You should try downloading it with a browser.')
raise Exception(
f'File {file_name} might be corrupted. You should try downloading it with a browser.'
)
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 download refactored with the following changes:

Comment thread process_data.py
Comment on lines -48 to +49
dictionary = dict()
dictionary = {}
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 build_vocab 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