Giter VIP home page Giter VIP logo

convnets's Introduction

convnets

๐Ÿšง Under construction

Convolutional Neural Networks and utilities for Computer Vision.

Models API

convnets offers implementations for the following models:

To instantiate a model you need to import the corresponding class and pass a valid configuration object to the constructor:

from convnets.models import ResNet

r18_config = {
	'l': [
		{'r': 2, 'f': 64},
		{'r': 2, 'f': 128},
		{'r': 2, 'f': 256},
		{'r': 2, 'f': 512}
	], 
	'b': False
}

model = ResNet(r18_config)

Or you can use one of the predefined configurations, or variants:

from convnets.models import ResNet, ResNetConfig

model = ResNet(ResNetConfig.r18)

You can find the implementation of each model and configuration examples in the convnets/models directory.

Training API

If you want to train a model in your notebooks, you can use our fit function:

form convnets.train import fit 

hist = fit(model, dataloader, optimizer, criterion, metrics, max_epochs)

You can use any Pytorch model. You will need to define the Pytorch dataloader, optimizer and criterion. For the metrics, the function expects a dict with the name of the metric as key and the metric function as value. The metric function must receive the model output and the target and return a scalar value. You can find some examples in convnets/metrics. The max_epochs parameter is the maximum number of epochs to train the model. The function will return a dict with the training history.

Additionally, we offer a training script that you can execute from the command line.

python scripts/train.py <path_to_config_file>

You will have to pass the path to a yaml file with the configuration for your training, including the model, optimizer, criterion, metrics, dataloader, etc. You can find some examples in the configs directory (which are timm and pytorch-lightning compatible).

We also offer Pytorch Lightning interoperability.

convnets's People

Contributors

earthpulse avatar juansensio avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.