Add a template generic example script as a quick start with Ignite
See original GitHub issue🚀 Feature
Idea is to simplify user’s learning curve and provide a template example that can be copied by the user and modified to his/her needs. Something like that but an executable working example:
def training():
train_loader, val_loader = get_dataflow(fold_index=fold_index, **kwargs)
model, optimizer, criterion, lr_scheduler = initialize_model(**kwargs)
metrics = {
"accuracy": Accuracy(),
}
trainer = create_supervised_trainer(model, optimizer, criterion)
@trainer.on(Events.EPOCH_COMPLETED)
def update_lr_scheduler(_):
lr_scheduler.step()
evaluator = create_supervised_evaluator(model, metrics=metrics)
@trainer.on(Events.ITERATION_COMPLETED(every=validate_every))
def validate(trainer):
evaluator.run(val_loader)
metrics = evaluator.state.metrics
print("After {} iterations, binary accuracy = {:.2f}"
.format(trainer.state.iteration, metrics['accuracy']))
trainer.run(train_loader, max_epochs=kwargs.get(max_epochs, 100))
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Creating and Configuring a Generic Script Resource
Create a Generic Script Resource using the High Availability Wizard · 1. Launch Failover Cluster Manager from the Start Menu. · 2. Connect...
Read more >Creating a Basic Substitution Template - Ignite UI™ Help
The following steps demonstrate how to create basic substitution template. Add and apply the row template using IG Template Engine. Add sample data...
Read more >Basic Cache Operations | Ignite Documentation
You can obtain IgniteCache for an existing cache, or you can create a cache dynamically. ... Note that different caches may have different...
Read more >Using Zabbix to Monitor Apache Ignite or Other Distributed ...
Go to Configuration->Templates->Import and, from the downloaded folder, import the zbx_export_templates.xml template. The template and the ...
Read more >QuickStart Guide to Building Templates - Matik Help
Step 0: Connect to Google Drive · Step 1: Create narrative and upload Template · Step 2: Connect to Data Source · Step...
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
@louis-she today we have also pytorch-ignite code generator that should be a sort of interactive cookiecutter. Please take a look and if you have any feedback on how to improve it, we would be happy to have it. Thanks
Wow the generator site is way more cooler thant cookiecutter 💯