Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

cifar_example.py 812 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  1. # Cifar10 Classification Training:
  2. # Reaches ~94.9 Accuracy after 250 Epochs
  3. import super_gradients
  4. from omegaconf import DictConfig
  5. import hydra
  6. import pkg_resources
  7. @hydra.main(config_path=pkg_resources.resource_filename("conf", ""), config_name="cifar10_resnet_conf")
  8. def train(cfg: DictConfig) -> None:
  9. # INSTANTIATE ALL OBJECTS IN CFG
  10. cfg = hydra.utils.instantiate(cfg)
  11. # CONNECT THE DATASET INTERFACE WITH DECI MODEL
  12. cfg.sg_model.connect_dataset_interface(cfg.dataset_interface, data_loader_num_workers=cfg.data_loader_num_workers)
  13. # BUILD NETWORK
  14. cfg.sg_model.build_model(cfg.architecture, load_checkpoint=cfg.load_checkpoint)
  15. # TRAIN
  16. cfg.sg_model.train(training_params=cfg.training_params)
  17. if __name__ == "__main__":
  18. super_gradients.init_trainer()
  19. train()
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...