Skip to content

Adding Broken-Up Files for mnist.py #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

e-corwin
Copy link
Owner

@e-corwin e-corwin commented Jul 8, 2022

  • Created new files that separate the functions of the mnist model: initializing.py, optimizing.py, automatic_differentiation.py, saving_and_loading.py
  • [initializing.py] initializes the networks layers by applying transformations on the image inputs
  • [optimizing.py]: trains and tests the model on FashionMNIST data, optimizes the model based on the training, sets hyperparameters
  • [automatic_differentiation.py]: backpropagation? not sure if/why this would be separate from training/optimizing
  • [saving_and_loading.py]: saves the model to a path for loading and running

@e-corwin e-corwin requested a review from siddk July 8, 2022 04:59
@siddk siddk changed the title adding broke up files Adding Broken-Up Files for mnist.py Jul 8, 2022
@siddk
Copy link
Collaborator

siddk commented Jul 8, 2022

So typically when writing PRs, we should use the description box to provide a concise, bulleted list of changes; can you edit the box above @e-corwin?

@siddk
Copy link
Collaborator

siddk commented Jul 8, 2022

Other high-level comment - in Python, the normal format for filenames/directory names is to use all lowercase names with underscores (_) separating words.

This is called "snake_case", and is just a different convention from Java's "CamelCase"

Optimizing.py Outdated
train_dataloader = DataLoader(training_data, batch_size=64)
test_dataloader = DataLoader(test_data, batch_size=64)

class NeuralNetwork(nn.Module):
Copy link
Collaborator

Choose a reason for hiding this comment

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

So this is a good linear split, but you see how we're duplicating code across files? How do we avoid that, and actually "import" code blocks from other files?

Let's talk about this today!

SavingAndLoading Outdated

## Saving and Loading Models with Shapes

torch.save(model, 'model.pth') # saving
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly, saving and loading should be functions of the existing models we've trained!

@e-corwin
Copy link
Owner Author

e-corwin commented Jul 8, 2022

So typically when writing PRs, we should use the description box to provide a concise, bulleted list of changes; can you edit the box above @e-corwin?

By PR I assumed you were referring to the comment box, I updated the box with more specificity to how I separated my files!

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.

2 participants