Code Monkey home page Code Monkey logo

general_dl's Introduction

General Deep Learning

A general deep learning project that can be easily transferred to other specific tasks.

Basic environment:


torch and timm

Structure of the repository


  • apis/
    • builder.py: Builds datasets, dataloaders, models, optimizers, schedulers, and more.
    • evaluator.py: Evaluates metrics.
    • runner.py: Handles training, validation, and inference.
    • sampler.py: Provides samplers for balanced, distributed, and other purposes.
    • visualizer.py: Offers visualization tools such as TSNE, metrics, and more.
  • datasets/
    • custom.py: Defines custom datasets for images.
    • preprocess.py: Preprocesses input data.
  • models/
    • backbones/: Defines networks of backbones (encoders / feature extractors, etc.).
    • losses/: Defines loss functions.
    • model/: Defines complete models (e.g., classifiers), including backbones, heads, and losses.
  • utils/
    • config.py: Interprets configuration files.
    • dist.py: Implements distributed training.
    • fileio.py: Loads and dumps files (e.g., json, pickle, txt, csv).
    • logger.py: Initializes logger.
    • seed.py: Sets random seed.
    • gen_imglist.py: Generates imagelists for datasets.
  • shutdown.py: Kills processes with keywords.
  • train.py and test.py: Main files for training (validation) and inference.
  • run.sh and run_test.sh: Scripts for experiments.
  • exp_dir/: Experimental directory including configuration files, logs, checkpoints, and more.

Instruction for usage


  • Prepare dataset
    data_root/
      - train/
      - val/
      - test/
      - {train, val, test}_label.txt (format: relative_path label)
  • Training
    sh run.sh
    # or
    nohup sh run.sh>train.out 2>&1 &
    Training logs and checkpoints will be saved in ./exp_dir/resnet18_cifar10
  • Inference
    sh run_test.sh
    # or
    nohup sh run_test.sh>test.out 2>&1 &
    Inference logs and results will be saved in ./exp_dir/resnet18_cifar10
  • Visualization Visualize loss, accuracy, TSNE, etc.

Extensions can be added to the existing codebase as needed

general_dl's People

Contributors

mouxiaohuang avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

general_dl's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.