Experiment __init__() + setup() + configure() is a confusing mess
See original GitHub issueSummary
The interactions between this cluster of API methods is confusing, and demos don’t provide clarifying examples. The ideas here are from a brainstorming session between @alecpm and @jessesnyder.
Goals
- Custom experiments should not need to override
__init__()
, except under extraordinary circumstances - Custom experiments should not need to call
super()
in standard cases, since this is always confusing and it can be hard to tell when it matters - Base class should handle the database transaction in standard cases
- Demos should clarify semantics of the API via consistent… demonstration.
Tentative Proposal
- Experiment base class’s
__init__()
method calls a private_setup()
(name TBD) and finishes with a database commit _setup()
handles idempotence by checkingif self.networks() is None
and creates basic network as the current base class’ssetup()
method does_setup()
callsself.setup()
at the endsetup()
has an empty implementation in the base class, and is where the subclass adds its own special nodes to the now-initialized networks- statements like
self.initial_recruitment_size = 2
belong inconfigure()
, not__init__()
orsetup()
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
exp init experience · Issue #7130 · iterative/dvc - GitHub
One goal of dvc exp init was to introduce an easy way to setup typical project structures, such as deep learning with checkpoints...
Read more >Enable loading and saving of question answers. · 7525ebcded ...
This lays the groundwork for interactive init, as well as being able to specify control and compute nodes. Added preliminary config lists for...
Read more >What do you want to know about the process of converting an ...
Hey everyone! I'm going to be giving a talk at VimConf this year on how to transition from an init.vim setup to an...
Read more >How to initialize test data for benchmark test in golang?
You can use *B.ResetTimer to remove the setup time from the overall benchmark ... ResetTimer() for i := 0; i < b.N; i++...
Read more >How to Keep Track of Experiments in PyTorch - neptune.ai
Setting up Neptune experiment in Pytorch ... Just pass on these as parameters to the init() function, that's how easy it is:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alecpm Makes sense. Maybe there is a way as part of this breaking change to make this dual functionality more explicit in the Experiment class.
@pmcharrison Generally the experiment class is only instantiated when programmatically launching experiment runs using APIs like
Experiment.run
andExperiment.collect
, and in tests. By default when an experiment is instantiated without a session, thesetup
andconfigure
methods aren’t run. The Experiment should always be instantiated with a DB session when used by the experiment server.