question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
vfdev-5commented, Dec 17, 2021

@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

1reaction
louis-shecommented, Dec 17, 2021

@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 💯

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found