Comments (5)
Hello, please use Please use the reweighting
option for using LBC. You can check the details here:
#1 (comment)
from cgl_fairness.
Hi, I'm sorry for a typo. It is iteration
, not iter
. And the iter
argument is used in trainer/rewieghting.py. It represents the number of iterations for outer update of eta in a minimax optimization.
We modified our README as well. Thanks.
from cgl_fairness.
@sangwon79 @SanghyukChun Thanks! However there still exists another error:
Traceback (most recent call last):
File "/data1/cgl_fairness/main.py", line 124, in <module>
main()
File "/data1/cgl_fairness/main.py", line 98, in main
trainer_.train(train_loader, test_loader, args.epochs, writer=writer)
File "/data1/cgl_fairness/trainer/reweighting.py", line 46, in train
weight_set = self.debias_weights(Y_train, S_train, extended_multipliers, num_groups, num_classes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data1/cgl_fairness/trainer/reweighting.py", line 207, in debias_weights
weights = w_matrix[sen_attrs, label]
~~~~~~~~^^^^^^^^^^^^^^^^^^
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)
so I use this in reweighting.py:
sen_attrs = sen_attrs.to(w_matrix.device)
label = label.to(w_matrix.device)
weights = w_matrix[sen_attrs, label]
It makes it run, but the score keeps in a low degree:
from cgl_fairness.
Thanks again.
The first issue may be due to the difference in the version of Torch package. It works well in our setting.
We left out a line of code in the process of publishing our code.
The first and second issues have been solved in the modified code. Please git pull again.
from cgl_fairness.
Thanks a lot! This has been solved.
from cgl_fairness.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cgl_fairness.