Skip to content

Update structure of MNIST example. - #634

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_342404042
Nov 15, 2020
Merged

Update structure of MNIST example.#634
copybara-service[bot] merged 1 commit into
masterfrom
test_342404042

Conversation

@copybara-service

Copy link
Copy Markdown

Update structure of MNIST example.

  • mnist_main.py -> main.py
  • mnist_lib.py -> train.py

The main.py shouldn't be used in any test.

@google-cla google-cla Bot added the cla: yes label Nov 14, 2020
@codecov-io

codecov-io commented Nov 14, 2020

Copy link
Copy Markdown

Codecov Report

Merging #634 (e165074) into master (80422e5) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #634   +/-   ##
=======================================
  Coverage   80.59%   80.59%           
=======================================
  Files          56       56           
  Lines        4241     4241           
=======================================
  Hits         3418     3418           
  Misses        823      823           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80422e5...e165074. Read the comment docs.

@andsteing andsteing self-assigned this Nov 14, 2020
@andsteing
andsteing self-requested a review November 14, 2020 15:32
@andsteing

Copy link
Copy Markdown
Contributor

Quoting from #231 :

  • To make it easier to test, maintain and reuse code structure the code as follows:

    • {example}_lib.py contains classes and methods for training and evaluating the model.
    • {example}_main.py contains the flags and calls a method from {example}_lib.py to run the training loop. This should be the only file defining flags!
    • {example}_lib_test.py for test cases of the training code. At a minimum the test should run a single training step but more fine grained unit tests are a bonus. You can use tfds.testing.mock_data to avoid real data from disk.

I'm fine with any structure, but it should be the same for every example. If you think the structure proposed in this PR is superior, we should update #231 and make sure all of the examples follow the updated structure.

@Marvin182

Copy link
Copy Markdown
Contributor

I agree. I updated #231.

@andsteing

Copy link
Copy Markdown
Contributor

@Marvin182

Copy link
Copy Markdown
Contributor

done

- mnist_main.py -> main.py
- mnist_lib.py -> train.py

The main.py shouldn't be used in any test.

PiperOrigin-RevId: 342517516
@copybara-service
copybara-service Bot merged commit 0c6a8ba into master Nov 15, 2020
@copybara-service
copybara-service Bot deleted the test_342404042 branch November 15, 2020 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants