-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08d8f31
commit 95367a9
Showing
1 changed file
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,73 @@ | ||
# scarf | ||
# 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 | ||
|
||
Create a virtual environment with Python >= 3.11 and install from git: | ||
Clone this repository, create a new Conda environment and | ||
|
||
```bash | ||
pip install git+https://github.com/chris-santiago/scarf.git | ||
git clone https://github.com/chris-santiago/scarf.git | ||
conda env create -f environment.yml | ||
cd scarf | ||
pip install -e . | ||
``` | ||
|
||
## Use | ||
|
||
### Prerequisites | ||
|
||
#### Hydra | ||
|
||
## Documentation | ||
This project uses [Hydra](https://hydra.cc/docs/intro/) for managing configuration CLI arguments. See `scarf/conf` for full | ||
configuration details. | ||
|
||
#### Task | ||
|
||
This project uses [Task](https://taskfile.dev/) as a task runner. Though the underlying Python | ||
commands can be executed without it, we recommend [installing Task](https://taskfile.dev/installation/) | ||
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](https://github.com/chris-santiago/cookie) and is | ||
setup to use [PDM](https://pdm.fming.dev/latest/) 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](https://wandb.ai/). It | ||
expects an API key within a `.env` file in the root directory: | ||
|
||
```toml | ||
WANDB_KEY=<my-super-secret-key> | ||
``` | ||
|
||
Documentation hosted on Github Pages: [https://chris-santiago.github.io/scarf/](https://chris-santiago.github.io/scarf/) | ||
Users can configure different logger(s) within the `conf/trainer/default.yaml` file. |