← 开源
richardaecn

class-balanced-loss

Class-Balanced Loss Based on Effective Number of Samples. CVPR 2019

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
615
Star
66
Fork
+0
本周
1
贡献者
创建于 2018-12-17 · 更新于 2026-09-08 · 今日第 16049 名
主要开发者
richardaecn

richardaecn/class-balanced-loss 排名第 16,049,有 615 个星标。

同类别比较

richardaecn/class-balanced-loss 排名第 16,049,此处有 8 个同类条目;pmixer/SASRec.pytorch 排名第 16,048。

同类别比较
名称排名指标
tatp22/multidim-positional-encoding16,034
语言:
Python
星标数:
616
分叉数:
35
简介:
An implementation of 1D, 2D, and 3D positional encoding in Pytorch and TensorFlow
LynnHo/AttGAN-Tensorflow16,037
语言:
Python
星标数:
615
分叉数:
137
简介:
[TIP'19] AttGAN: Facial Attribute Editing by Only Changing What You Want
mondejar/ecg-classification16,046
语言:
Python
星标数:
615
分叉数:
200
简介:
Code for training and test machine learning classifiers on MIT-BIH Arrhyhtmia database
pmixer/SASRec.pytorch16,048
语言:
TeX
星标数:
615
分叉数:
133
简介:
PyTorch(1.6+) implementation of https://github.com/kang205/SASRec
zcakhaa/DeepLOB-Deep-Convolutional-Neural-Networks-for-Limit-Order-Books16,050
语言:
Jupyter Notebook
星标数:
615
分叉数:
255
简介:
This jupyter notebook is used to demonstrate our recent work, "DeepLOB: Deep Convolutional Neural Networks for Limit Order Books", published in IEEE Transactions on Singal Processing. We use FI-2010 dataset and present how model architecture is constructed here. The FI-2010 is publicly avilable and interested readers can check out their paper.
inclusionAI/ASearcher16,057
语言:
Python
星标数:
614
分叉数:
40
简介:
An Open-Source Large-Scale Reinforcement Learning Project for Search Agents
ServiceNow/N-BEATS16,063
语言:
Python
星标数:
613
分叉数:
131
简介:
N-BEATS is a neural-network based model for univariate timeseries forecasting. N-BEATS is a ServiceNow Research project that was started at Element AI.
araffin/sbx16,067
语言:
Python
星标数:
613
分叉数:
61
简介:
SBX: Stable Baselines Jax (SB3 + Jax) RL algorithms
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Architecture
星标数615
分叉数66
贡献者1
创建日期2018-12-17
更新日期2026-09-08
1 天星标数0
7 天星标数0
排名16,049
上次排名15,849
排名变化-200
7 天星标排名15,319
上次 7 天星标排名15,331
7 天星标排名变化12
总星标排名16,468
上次总星标排名16,443
总星标排名变化-25
国家USA
README 摘录

Class-Balanced Loss Based on Effective Number of Samples Tensorflow code for the paper: *Class-Balanced Loss Based on Effective Number of Samples*\ Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, Serge Belongie Dependencies: Python (3. We provide a download link that includes all the data used in our paper in . The data was converted and generated by (original CIFAR) and (long-tailed CIFAR). Effective Number of Samples: For a visualization of the data and effective number of samples

, please take a look at . Key Implementation Details: Weights for class-balanced loss Focal loss Assigning weights to different loss Initialization of the last layer Training and Evaluation: We provide 3 . On original CIFAR dataset: On long-tailed CIFAR dataset (the hyperparameter is the inverse of "Imbalance Factor" in the paper): On long-tailed CIFAR dataset using the proposed class-balanced loss (set non-zero ): Run Tensorboard for visualization: The figure below are the results of running and : Training with

TPU: We train networks on iNaturalist and ImageNet datasets using Google's Cloud TPU. Our code is based on the official implementation of Training ResNet on Cloud TPU and forked from Data Preparation: Download datasets (except images) from this link and unzip it under . The unzipped directory contains the training and validation splits. For raw images, please download from the following links and put them into the corresponding folders in : iNaturalist 2017 iNaturalist 2018 ImageNet (ILSVRC2012) Convert datasets into . tfrecords format

and upload to Google Cloud Storage (gcs) using : The following 3 . sh scripts in can be used to train and evaluate models on iNaturalist and ImageNet using Cloud TPU. For more details on how to use Cloud TPU, please refer to Training ResNet on Cloud TPU. Note that the image mean and standard deviation and input size need to be updated accordingly.

常见问题

记录了多少星标和分叉?

richardaecn/class-balanced-loss 有 615 个星标和 66 个分叉。

仓库排名是多少?

richardaecn/class-balanced-loss 排名第 16,049。

记录的语言和类别是什么?

richardaecn/class-balanced-loss 有 615 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

richardaecn/class-balanced-loss 与 pmixer/SASRec.pytorch 比较,后者排名第 16,048,有 615 个星标。

README

Class-Balanced Loss Based on Effective Number of Samples

Tensorflow code for the paper:

Class-Balanced Loss Based on Effective Number of Samples
Yin Cui, Menglin Jia, Tsung-Yi Lin, Yang Song, Serge Belongie

Dependencies:

  • Python (3.6)
  • Tensorflow (1.14)

Datasets:

  • Long-Tailed CIFAR. We provide a download link that includes all the data used in our paper in .tfrecords format. The data was converted and generated by src/generate_cifar_tfrecords.py (original CIFAR) and src/generate_cifar_tfrecords_im.py (long-tailed CIFAR).

Effective Number of Samples:

For a visualization of the data and effective number of samples, please take a look at data.ipynb.

Key Implementation Details:

Training and Evaluation:

We provide 3 .sh scripts for training and evaluation.

  • On original CIFAR dataset:
./cifar_trainval.sh
  • On long-tailed CIFAR dataset (the hyperparameter IM_FACTOR is the inverse of "Imbalance Factor" in the paper):
./cifar_im_trainval.sh
  • On long-tailed CIFAR dataset using the proposed class-balanced loss (set non-zero BETA):
./cifar_im_trainval_cb.sh
  • Run Tensorboard for visualization:
tensorboard --logdir=./results --port=6006
  • The figure below are the results of running ./cifar_im_trainval.sh and ./cifar_im_trainval_cb.sh:

Training with TPU:

We train networks on iNaturalist and ImageNet datasets using Google's Cloud TPU. The code for this section is in tpu/. Our code is based on the official implementation of Training ResNet on Cloud TPU and forked from https://github.com/tensorflow/tpu.

Data Preparation:

  • Download datasets (except images) from this link and unzip it under tpu/. The unzipped directory tpu/raw_data/ contains the training and validation splits. For raw images, please download from the following links and put them into the corresponding folders in tpu/raw_data/:

  • Convert datasets into .tfrecords format and upload to Google Cloud Storage (gcs) using tpu/tools/datasets/dataset_to_gcs.py:

python dataset_to_gcs.py \
  --project=$PROJECT \
  --gcs_output_path=$GCS_DATA_DIR \
  --local_scratch_dir=$LOCAL_TFRECORD_DIR \
  --raw_data_dir=$LOCAL_RAWDATA_DIR

The following 3 .sh scripts in tpu/ can be used to train and evaluate models on iNaturalist and ImageNet using Cloud TPU. For more details on how to use Cloud TPU, please refer to Training ResNet on Cloud TPU.

Note that the image mean and standard deviation and input size need to be updated accordingly.

  • On ImageNet (ILSVRC 2012):
./run_ILSVRC2012.sh
  • On iNaturalist 2017:
./run_inat2017.sh
  • On iNaturalist 2018:
./run_inat2018.sh
  • The pre-trained models, including all logs viewable on tensorboard, can be downloaded from the following links:
Dataset Network Loss Input Size Download Link
ILSVRC 2012 ResNet-50 Class-Balanced Focal Loss 224 link
iNaturalist 2018 ResNet-50 Class-Balanced Focal Loss 224 link

Citation

If you find our work helpful in your research, please cite it as:

@inproceedings{cui2019classbalancedloss,
  title={Class-Balanced Loss Based on Effective Number of Samples},
  author={Cui, Yin and Jia, Menglin and Lin, Tsung-Yi and Song, Yang and Belongie, Serge},
  booktitle={CVPR},
  year={2019}
}
排名相邻
同类项目