Giter Club home page Giter Club logo

fairdrop's Introduction

FairDrop

This is the companion code for the paper:

Spinelli I, Scardapane S, Hussain A, Uncini A, FairDrop: Biased Edge Dropout for Enhancing Fairness in Graph Representation Learning, IEEE Transactions on Artificial Intelligence 2021.

Fair edge dropout

We introduce a flexible biased edge dropout algorithm for enhancing fairness in graph representation learning. FairDrop targets the negative effect of the network's homophily w.r.t the sensitive attribute.

Schematics of the proposed framework.

Acknowledgments

Many thanks to the authors of [1] for making their code public and to the maintainers [3] for such an awesome open-source library.

Cite

Please cite our paper if you use this code in your own work:

@ARTICLE{spinelli2021fairdrop,
  author={Spinelli, Indro and Scardapane, Simone and Hussain, Amir and Uncini, Aurelio},
  journal={IEEE Transactions on Artificial Intelligence}, 
  title={FairDrop: Biased Edge Dropout for Enhancing Fairness in Graph Representation Learning}, 
  year={2021},
  volume={},
  number={},
  pages={1-1},
  doi={10.1109/TAI.2021.3133818}}

fairdrop's People

Contributors

spindro avatar

Stargazers

 avatar RitaRao avatar  avatar  avatar Jeff Carpenter avatar Adrián Arnaiz-Rodríguez avatar Chunhui Zhang avatar zicun cong avatar Jia Li avatar  avatar  avatar Pepe avatar

Watchers

James Cloos avatar  avatar

fairdrop's Issues

DataLoader Error in FairNodeEmd

Hi,
I am running the notebook of 'fair_node_embedding'. But an unexpected error raised:

    760         try:
--> 761             data = self._data_queue.get(timeout=timeout)
    762             return (True, data)

/mnt/data1/jjs/anaconda3/envs/HPIC/lib/python3.7/multiprocessing/queues.py in get(self, block, timeout)
    103                     timeout = deadline - time.monotonic()
--> 104                     if not self._poll(timeout):
    105                         raise Empty

/mnt/data1/jjs/anaconda3/envs/HPIC/lib/python3.7/multiprocessing/connection.py in poll(self, timeout)
    256         self._check_readable()
--> 257         return self._poll(timeout)
    258 

/mnt/data1/jjs/anaconda3/envs/HPIC/lib/python3.7/multiprocessing/connection.py in _poll(self, timeout)
    413     def _poll(self, timeout):
--> 414         r = wait([self], timeout)
    415         return bool(r)

/mnt/data1/jjs/anaconda3/envs/HPIC/lib/python3.7/multiprocessing/connection.py in wait(object_list, timeout)
    919             while True:
--> 920                 ready = selector.select(timeout)
    921                 if ready:

/mnt/data1/jjs/anaconda3/envs/HPIC/lib/python3.7/selectors.py in select(self, timeout)
    414         try:
--> 415             fd_event_list = self._selector.poll(timeout)
    416         except InterruptedError:

/mnt/data1/jjs/anaconda3/envs/HPIC/lib/python3.7/site-packages/torch/utils/data/_utils/signal_handling.py in handler(signum, frame)
     65         # Python can still get and update the process status successfully.
---> 66         _error_if_any_worker_fails()
     67         if previous_handler is not None:

RuntimeError: DataLoader worker (pid 54088) is killed by signal: Segmentation fault. 

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
/tmp/ipykernel_53070/3824334877.py in <module>
      9         Y_aux,
     10         randomization[epoch],
---> 11         N,
     12     )

/mnt/data1/jjs/Documents/Fair/FairDrop/utils.py in train_rn2v_adaptive(model, loader, optimizer, device, pos_edge_index_tr, y_aux, rand, N)
    110     total_loss = 0
    111 
--> 112     for pos_rw, neg_rw in loader:
    113 
    114         optimizer.zero_grad()

/mnt/data1/jjs/anaconda3/envs/HPIC/lib/python3.7/site-packages/torch/utils/data/dataloader.py in __next__(self)
    343 
    344     def __next__(self):
--> 345         data = self._next_data()
    346         self._num_yielded += 1
    347         if self._dataset_kind == _DatasetKind.Iterable and \

/mnt/data1/jjs/anaconda3/envs/HPIC/lib/python3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self)
    839 
    840             assert not self._shutdown and self._tasks_outstanding > 0
--> 841             idx, data = self._get_data()
    842             self._tasks_outstanding -= 1
    843 

/mnt/data1/jjs/anaconda3/envs/HPIC/lib/python3.7/site-packages/torch/utils/data/dataloader.py in _get_data(self)
    806         else:
    807             while True:
--> 808                 success, data = self._try_get_data()
    809                 if success:
    810                     return data

/mnt/data1/jjs/anaconda3/envs/HPIC/lib/python3.7/site-packages/torch/utils/data/dataloader.py in _try_get_data(self, timeout)
    772             if len(failed_workers) > 0:
    773                 pids_str = ', '.join(str(w.pid) for w in failed_workers)
--> 774                 raise RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly'.format(pids_str))
    775             if isinstance(e, queue.Empty):
    776                 return (False, None)

RuntimeError: DataLoader worker (pid(s) 54088, 54108) exited unexpectedly```
Can u help me fix the error?

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.