All Projects → yaodongyu → Rethink-BiasVariance-Tradeoff

yaodongyu / Rethink-BiasVariance-Tradeoff

Licence: other
Rethinking Bias-Variance Trade-off for Generalization of Neural Networks

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Rethink-BiasVariance-Tradeoff

AnnA Anki neuronal Appendix
Using machine learning on your anki collection to enhance the scheduling via semantic clustering and semantic similarity
Stars: ✭ 39 (-15.22%)
Mutual labels:  machinelearning
datascience-mashup
In this repo I will try to gather all of the projects related to data science with clean datasets and high accuracy models to solve real world problems.
Stars: ✭ 36 (-21.74%)
Mutual labels:  machinelearning
incogly
Incogly is a video conferencing app aimed to remove any implicit bias in an interview and easing the process of remote collaboration.
Stars: ✭ 24 (-47.83%)
Mutual labels:  machinelearning
youtube-or-pornhub
Service identification on ciphered traffic.
Stars: ✭ 26 (-43.48%)
Mutual labels:  machinelearning
mildnet
Visual Similarity research at Fynd. Contains code to reproduce 2 of our research papers.
Stars: ✭ 76 (+65.22%)
Mutual labels:  machinelearning
fal
do more with dbt. fal helps you run Python alongside dbt, so you can send Slack alerts, detect anomalies and build machine learning models.
Stars: ✭ 567 (+1132.61%)
Mutual labels:  machinelearning
Kapsul-Aglari-ile-Isaret-Dili-Tanima
Recognition of Sign Language using Capsule Networks
Stars: ✭ 42 (-8.7%)
Mutual labels:  machinelearning
awesome-open-mlops
The Fuzzy Labs guide to the universe of open source MLOps
Stars: ✭ 304 (+560.87%)
Mutual labels:  machinelearning
SwiftUIMLKitTranslator
SwiftUI MLKit Language Identification & Translator
Stars: ✭ 23 (-50%)
Mutual labels:  machinelearning
type4py
Type4Py: Deep Similarity Learning-Based Type Inference for Python
Stars: ✭ 41 (-10.87%)
Mutual labels:  machinelearning
TextFeatureSelection
Python library for feature selection for text features. It has filter method, genetic algorithm and TextFeatureSelectionEnsemble for improving text classification models. Helps improve your machine learning models
Stars: ✭ 42 (-8.7%)
Mutual labels:  machinelearning
Data-Science-Resources
A guide to getting started with Data Science and ML.
Stars: ✭ 17 (-63.04%)
Mutual labels:  machinelearning
k3ai-core
K3ai-core is the core library for the GO installer. Go installer will replace the current bash installer
Stars: ✭ 23 (-50%)
Mutual labels:  machinelearning
spotify-vibe-check
Spotify Vibe Checker Web App to vibe check your Spotify Playlists! (currently broken due to CORS)
Stars: ✭ 24 (-47.83%)
Mutual labels:  machinelearning
Groundbreaking-Papers
ML Research paper summaries, annotated papers and implementation walkthroughs
Stars: ✭ 90 (+95.65%)
Mutual labels:  machinelearning
pollinations
Generate Art
Stars: ✭ 100 (+117.39%)
Mutual labels:  machinelearning
DEEPaaS
A REST API to serve machine learning and deep learning models
Stars: ✭ 26 (-43.48%)
Mutual labels:  machinelearning
human-in-the-loop-machine-learning-tool-tornado
Tornado is a human-in-the-loop machine learning framework that helps you exploit your unlabelled data to train models through a simple and easy to use web interface.
Stars: ✭ 37 (-19.57%)
Mutual labels:  machinelearning
ML-For-Beginners
12 weeks, 26 lessons, 52 quizzes, classic Machine Learning for all
Stars: ✭ 40,023 (+86906.52%)
Mutual labels:  machinelearning
Anjani
🤖 Telegram group management bot with spam protection
Stars: ✭ 45 (-2.17%)
Mutual labels:  machinelearning

Rethink-BiasVariance-Tradeoff

This is the code for the ICML'20 paper "Rethinking Bias-Variance Trade-off for Generalization of Neural Networks".

Risk, bias, and variance for ResNet34 on CIFAR10 dataset (25,000 training samples).

Prerequisites

  • Python
  • Pytorch (1.3.1)
  • CUDA
  • numpy

How to train models on different datasets (MSE loss & MSE bias-variance decomposition)?

There are 4 folders, cifar10, cifar100, fmnist, and mnist. First cd into the directory. Then run

python train.py --trial 2 --arch resnet34 --width 10 --num-epoch 500 --lr-decay 200 --outdir part1

Arguments:

  • trial: how many splits, i.e., if trial=2 on cifar10, then the trainig sample size is 50000/2 = 25000.
  • arch: network architecture.
  • width: width of the network.
  • num-epoch: how many epochs for training.
  • lr-decay: after how many epochs to decay the learning rate.
  • outdir: specify the name of the folder for saving logs and checkpoints.

Log file:

The results (including bias and variance) will be save in 'log_width{}.txt'.format(args.width) , in the folder '{}_{}_trial{}_mse{}'.format(args.dataset, args.arch, args.trial, args.outdir).

The log file includes the following,

trial train loss train acc test loss test acc bias variance

How to train models on CIFAR10 datasets with label noise?

First cd into the cifar10 folder. Then run

python train_labelnoise.py --trial 5 --arch resnet34 --width 10 --noise-size 1000

Arguments:

  • noise-size: specify the number of label noise for each split of the dataset. For example, here trial=5, the training sample size is 10000, the label noise size is 1000, which means that the label noise percentage is 1000/10000=10%.

Log file:

The results (including bias and variance) will be save in 'log_width{}.txt'.format(args.width), in the folder '{}_{}_trial{}_labelnoise{}_mse{}'.format(args.dataset, args.arch, args.trial, args.noise_size, args.outdir).

How to train models on CIFAR10 datasets with cross-entropy loss (CE loss & generalized Bregman divergence bias-variance decomposition)?

First cd into the cifar10 folder. Then run

python train_ce.py --trial 5 --arch resnet34 --width 10

Log file:

The results (including bias and variance) will be save in 'log_width{}.txt'.format(args.width), in the folder '{}_{}_trial{}_ce{}'.format(args.dataset, args.arch, args.trial, args.outdir).

The bias and variance save in 'log_width{}.txt'.format(args.width) is the classical MSE bias variance decomposition. To compute the generalized Bregman divergence bias variance decomposition, need to run

python evaluate_bv_ce.py --model-dir-list cifar10_resnet34_trial5_cepart1 cifar10_resnet34_trial5_cepart2 --outdir ce_bv_results --width 10

Arguments:

  • model-dir-list: specify the folders for evaluations. For example, here we will calculate the bias and variance based on the models (width=10) saved in cifar10_resnet34_trial5_cepart1 and cifar10_resnet34_trial5_cepart2. The total number of models is 5 * 2 = 10.
  • outdir: the folder name for saving the computed results.

Figures:

Bias and variance under different label noise percentage. Increasing label noise leads to double-descent phenomenon. ResNet34 using MSE loss on CIFAR10 dataset with 10,000 training samples.

Training error and test error under different label noise percentage. Increasing label noise leads to double-descent phenomenon. ResNet34 using MSE loss on CIFAR10 dataset with 10,000 training samples.

How to evaluate bias variance on CIFAR10-C (out-of-distribution) dataset (MSE divergence bias-variance decomposition)?

First, cd into the cifar10 folder, then download CIFAR-10-C dataset by

mkdir -p ./data/cifar
curl -O https://zenodo.org/record/2535967/files/CIFAR-10-C.tar
curl -O https://zenodo.org/record/3555552/files/CIFAR-100-C.tar
tar -xvf CIFAR-100-C.tar -C data/cifar/
tar -xvf CIFAR-10-C.tar -C data/cifar/

next, run

python evaluate_bv_mse_ood.py --modeldir cifar10_resnet34_trial2_mse --outdir ood_bv_results --width 10

Log file:

The results (including bias and variance) will be save in 'log_width{}.txt'.format(args.width), in the folder ood_bv_results.

Arguments:

  • modeldir: specify the folder for evaluations.
  • outdir: the folder name for saving the computed results.

Reference

For more experimental and technical details, please check our paper.

@inproceedings{yang2020rethinking,
  author = {Zitong Yang and Yaodong Yu and Chong You and Jacob Steinhardt and Yi Ma},
  booktitle = {International Conference on Machine Learning (ICML)},
  title = {Rethinking bias-variance trade-off for generalization of neural networks},
  year = {2020},
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].