← Open Source
Mikoto10032

AutomaticWeightedLoss

Multi-task learning using uncertainty to weigh losses for scene geometry and semantics, Auxiliary Tasks in Multi-task Learning.

Model DevelopmentArchitecturePython
Open on GitHub
Momentum
+1stars in 24 hours+0.2%
650
Stars
85
Forks
+0
This week
1
Contributors
Created 2020-06-07 · Updated 2026-10-16 · #6516 today
Top developers

Mikoto10032/AutomaticWeightedLoss is ranked 6,516 with 650 stars.

Same-category comparison

Mikoto10032/AutomaticWeightedLoss is ranked 6,516 among these 8 peers; pliang279/MultiBench is ranked 6,509.

Same-category comparison
NameRankMetrics
BrainCog-X/Brain-Cog6,496
Language:
Python
Stars:
662
Forks:
110
Description:
Brain-inspired Cognitive Intelligence Engine (BrainCog) is a brain-inspired spiking neural network based platform for Brain-inspired Artificial Intelligence and simulating brains at multiple scales. The long term goal of BrainCog is to provide a comprehensive theory and system to decode the mechanisms and principles of human intelligence and its evolution, and develop artificial brains for brain-inspired conscious living AI in future Human-AI symbiotic Society.
Zielon/MICA6,499
Language:
Python
Stars:
660
Forks:
97
Description:
MICA - Towards Metrical Reconstruction of Human Faces [ECCV2022].
facebookresearch/Ego4d6,508
Language:
Jupyter Notebook
Stars:
654
Forks:
66
Description:
Ego4d dataset repository. Download the dataset, visualize, extract features & example usage of the dataset.
pliang279/MultiBench6,509
Language:
HTML
Stars:
654
Forks:
101
Description:
[NeurIPS 2021] Multiscale Benchmarks for Multimodal Representation Learning.
gregversteeg/corex_topic6,524
Language:
Python
Stars:
647
Forks:
117
Description:
Hierarchical unsupervised and semi-supervised topic models for sparse count data with CorEx.
redai-studio/Relax6,525
Language:
Python
Stars:
647
Forks:
180
Description:
An Asynchronous Reinforcement Learning Engine for Omni-Modal Post-Training at Scale.
pymc-devs/pytensor6,526
Language:
Python
Stars:
646
Forks:
222
Description:
PyTensor allows you to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.
mahmoodlab/TRIDENT6,533
Language:
Python
Stars:
644
Forks:
146
Description:
Toolkit for large-scale whole-slide image processing.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryArchitecture
Stars650
Forks85
Contributors1
Created date2020-06-07
Updated date2026-10-16
Stars in 1 day1
Stars in 7 days0
Rank6,516
Previous rank15,327
Rank change8,811
7-day stars rank15,022
Previous 7-day stars rank17,738
7-day stars rank change2,716
Total stars rank15,755
Previous total stars rank15,752
Total stars rank change-3
CountryChina
README summary

AutomaticWeightedLoss A PyTorch implementation of Liebel L, Körner M. Auxiliary tasks in multi-task learning[J]. The above paper improves the paper "Multi-task learning using uncertainty to weigh losses for scene geometry and semantics" to avoid the loss of becoming negative during training. Requirements Python PyTorch How to Train with Your Model Clone the repository Create an AutomaticWeightedLoss module Create an optimizer to learn weight coefficients A complete example Something to Say Actually, it is not always effective

, but I hope it can help you.

Frequently asked questions

How many stars and forks are recorded?

Mikoto10032/AutomaticWeightedLoss has 650 stars and 85 forks.

What is the repository rank?

Mikoto10032/AutomaticWeightedLoss is ranked 6,516.

What language and category are recorded?

Mikoto10032/AutomaticWeightedLoss has 650 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

Mikoto10032/AutomaticWeightedLoss is compared with pliang279/MultiBench, ranked 6,509 with 654 stars.

README

AutomaticWeightedLoss

A PyTorch implementation of Liebel L, Körner M. Auxiliary tasks in multi-task learning[J]. arXiv preprint arXiv:1805.06334, 2018.

The above paper improves the paper "Multi-task learning using uncertainty to weigh losses for scene geometry and semantics" to avoid the loss of becoming negative during training.

Requirements

  • Python
  • PyTorch

How to Train with Your Model

  • Clone the repository
git clone git@github.com:Mikoto10032/AutomaticWeightedLoss.git
  • Create an AutomaticWeightedLoss module
from AutomaticWeightedLoss import AutomaticWeightedLoss

awl = AutomaticWeightedLoss(2)	# we have 2 losses
loss1 = 1
loss2 = 2
loss_sum = awl(loss1, loss2)
  • Create an optimizer to learn weight coefficients
from torch import optim

model = Model()
optimizer = optim.Adam([
                {'params': model.parameters()},
                {'params': awl.parameters(), 'weight_decay': 0}	
            ])
  • A complete example
from torch import optim
from AutomaticWeightedLoss import AutomaticWeightedLoss

model = Model()

awl = AutomaticWeightedLoss(2)	# we have 2 losses
loss_1 = ...
loss_2 = ...

# learnable parameters
optimizer = optim.Adam([
                {'params': model.parameters()},
                {'params': awl.parameters(), 'weight_decay': 0}
            ])

for i in range(epoch):
    for data, label1, label2 in data_loader:
        # forward
        pred1, pred2 = Model(data)	
        # calculate losses
        loss1 = loss_1(pred1, label1)
        loss2 = loss_2(pred2, label2)
        # weigh losses
        loss_sum = awl(loss1, loss2)
        # backward
        optimizer.zero_grad()
        loss_sum.backward()
        optimizer.step()

Something to Say

Actually, it is not always effective, but I hope it can help you.

Nearby in the ranking
Similar items