https://github.com/chris-santiago/scarf

Reproducing the SCARF framework with PyTorch

https://github.com/chris-santiago/scarf

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.8%) to scientific vocabulary

Keywords

contrastive-learning hydra pytorch pytorch-lightning scarf self-supervised-learning taskfile
Last synced: 5 months ago · JSON representation

Repository

Reproducing the SCARF framework with PyTorch

Basic Info
  • Host: GitHub
  • Owner: chris-santiago
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 30 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
contrastive-learning hydra pytorch pytorch-lightning scarf self-supervised-learning taskfile
Created almost 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.md

SCARF - PyTorch

This repo reproduces the SCARF (Self-Supervised Contrastive Learning Using Random Feature Corruption) framework for self-supervised learning with tabular data.

Authors: Dara Bahri, Heinrich Jiang, Yi Tay, Donald Metzler

Reference: Bahri, Dara, et al. "Scarf: Self-supervised contrastive learning using random feature corruption." arXiv preprint arXiv:2106.15147 (2021).

Original paper: https://research.google/pubs/scarf-self-supervised-contrastive-learning-using-random-feature-corruption/

Original repo: --

Install

Clone this repository, create a new Conda environment and

bash git clone https://github.com/chris-santiago/scarf.git conda env create -f environment.yml cd scarf pip install -e .

Use

Prerequisites

Hydra

This project uses Hydra for managing configuration CLI arguments. See scarf/conf for full configuration details.

Task

This project uses Task as a task runner. Though the underlying Python commands can be executed without it, we recommend installing Task for ease of use. Details located in Taskfile.yml.

Current commands

```bash

task -l task: Available tasks for this project: * check-config: Check Hydra configuration * compare: Compare using linear baselines * train: Train a model * wandb: Login to Weights & Biases ```

Example: Train model and for adult-income dataset experiment

The -- forwards CLI arguments to Hydra.

bash task train -- experiment=income

PDM

This project was built using this cookiecutter and is setup to use PDM for dependency management, though it's not required for package installation.

Weights and Biases

This project is set up to log experiment results with Weights and Biases. It expects an API key within a .env file in the root directory:

toml WANDB_KEY=<my-super-secret-key>

Users can configure different logger(s) within the conf/trainer/default.yaml file.

Owner

  • Name: Chris Santiago
  • Login: chris-santiago
  • Kind: user

GitHub Events

Total
Last Year

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 19
  • Total Committers: 1
  • Avg Commits per committer: 19.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
chris-santiago c****o@g****u 19
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/docs.yaml actions
  • actions/cache v2 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/publish.yaml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
pyproject.toml pypi
  • hydra-core >=1.3.2
  • hydra-joblib-launcher >=1.2.0
  • info-nce-pytorch >=0.1.4
  • matplotlib >=3.8.3
  • pandas >=2.2.1
  • python-dotenv >=1.0.1
  • pytorch-lightning >=2.2.1
  • pytorch-metric-learning >=2.4.1
  • rich >=13.7.1
  • scikit-learn >=1.4.1.post1
  • torch >=2.2.1
  • torchmetrics >=1.3.1
  • wandb >=0.16.3
requirements.txt pypi
  • aiohttp ==3.9.3
  • aiosignal ==1.3.1
  • antlr4-python3-runtime ==4.9.3
  • appdirs ==1.4.4
  • attrs ==23.2.0
  • certifi ==2024.2.2
  • charset-normalizer ==3.3.2
  • click ==8.1.7
  • colorama ==0.4.6
  • contourpy ==1.2.0
  • cycler ==0.12.1
  • docker-pycreds ==0.4.0
  • filelock ==3.13.1
  • fonttools ==4.49.0
  • frozenlist ==1.4.1
  • fsspec ==2024.2.0
  • gitdb ==4.0.11
  • gitpython ==3.1.42
  • hydra-core ==1.3.2
  • hydra-joblib-launcher ==1.2.0
  • idna ==3.6
  • info-nce-pytorch ==0.1.4
  • jinja2 ==3.1.3
  • joblib ==1.3.2
  • kiwisolver ==1.4.5
  • lightning-utilities ==0.10.1
  • markdown-it-py ==3.0.0
  • markupsafe ==2.1.5
  • matplotlib ==3.8.3
  • mdurl ==0.1.2
  • mpmath ==1.3.0
  • multidict ==6.0.5
  • networkx ==3.2.1
  • numpy ==1.26.4
  • nvidia-cublas-cu12 ==12.1.3.1
  • nvidia-cuda-cupti-cu12 ==12.1.105
  • nvidia-cuda-nvrtc-cu12 ==12.1.105
  • nvidia-cuda-runtime-cu12 ==12.1.105
  • nvidia-cudnn-cu12 ==8.9.2.26
  • nvidia-cufft-cu12 ==11.0.2.54
  • nvidia-curand-cu12 ==10.3.2.106
  • nvidia-cusolver-cu12 ==11.4.5.107
  • nvidia-cusparse-cu12 ==12.1.0.106
  • nvidia-nccl-cu12 ==2.19.3
  • nvidia-nvjitlink-cu12 ==12.4.99
  • nvidia-nvtx-cu12 ==12.1.105
  • omegaconf ==2.3.0
  • packaging ==23.2
  • pandas ==2.2.1
  • pillow ==10.2.0
  • protobuf ==4.25.3
  • psutil ==5.9.8
  • pygments ==2.17.2
  • pyparsing ==3.1.2
  • python-dateutil ==2.9.0.post0
  • python-dotenv ==1.0.1
  • pytorch-lightning ==2.2.1
  • pytorch-metric-learning ==2.4.1
  • pytz ==2024.1
  • pyyaml ==6.0.1
  • requests ==2.31.0
  • rich ==13.7.1
  • scikit-learn ==1.4.1.post1
  • scipy ==1.12.0
  • sentry-sdk ==1.40.6
  • setproctitle ==1.3.3
  • setuptools ==69.1.1
  • six ==1.16.0
  • smmap ==5.0.1
  • sympy ==1.12
  • threadpoolctl ==3.3.0
  • torch ==2.2.1
  • torchmetrics ==1.3.1
  • tqdm ==4.66.2
  • triton ==2.2.0
  • typing-extensions ==4.10.0
  • tzdata ==2024.1
  • urllib3 ==2.2.1
  • wandb ==0.16.4
  • yarl ==1.9.4
environment.yml conda
  • bzip2 1.0.8.*
  • ca-certificates 2022.12.7.*
  • libffi 3.4.2.*
  • libsqlite 3.40.0.*
  • libzlib 1.2.13.*
  • ncurses 6.3.*
  • openssl 3.1.0.*
  • pip 23.1.*
  • python 3.11.*
  • readline 8.2.*
  • setuptools 67.6.1.*
  • tk 8.6.12.*
  • tzdata 2023c.*
  • wheel 0.40.0.*
  • xz 5.2.6.*