Thank you for your interest in contributing to carefree-learn
! Before you begin writing code, it is important that you share your intention to contribute with the team, based on the type of contribution:
- You want to propose a new feature and implement it.
- Post about your intended feature in an issue, and we shall discuss the design and implementation. Once we agree that the plan looks good, go ahead and implement it.
- You want to implement a feature or bug-fix for an outstanding issue.
- Search for your issue in the
carefree-learn
issue list. - Pick an issue and comment that you'd like to work on the feature or bug-fix.
- If you need more context on a particular issue, please ask and we shall provide.
- Search for your issue in the
Once you implement and test your feature or bug-fix, please include some unittests and submit a Pull Request to https://github.com/carefree0910/carefree-learn.
To develop carefree-learn
on your machine, here are some tips:
- Uninstall all existing
carefree-learn
installs:
conda uninstall carefree-learn
pip uninstall carefree-learn
-
Follow Installation Guide to install
carefree-learn
. Remember to choose theGitHub
tab in the pip installation section. -
Follow Style Guide and happy coding!
carefree-learn
adopted black
and mypy
to stylize its codes, so you may need to check the format, coding style and type hint with them before your codes could actually be merged.
Besides, there are a few more principles that I'm using for sorting imports:
- From short to long (for both naming and path).
- From a to z (alphabetically).
- Divided into four sections:
import ...
import ... as ...
from ... import ...
- relative imports
- From general to specific (a
*
will always appear at the top of each section)
Here's an example to illustrate these (source code):
import os
import json
import torch
import optuna
import numpy as np
import optuna.visualization as vis
from typing import *
from functools import partial
from tqdm.autonotebook import tqdm
from cftool.misc import shallow_copy_dict
from cftool.misc import lock_manager
from cftool.misc import Saving
from cfdata.tabular import task_type_type
from cfdata.tabular import parse_task_type
from cfdata.tabular import TabularData
from optuna.trial import TrialState
from optuna.trial import FrozenTrial
from optuna.importance import BaseImportanceEvaluator
from plotly.graph_objects import Figure
from .basic import *
from .ensemble import *
from .hpo import optuna_tune
from .hpo import default_scoring
from .hpo import optuna_params_type
from .hpo import OptunaPresetParams
from .production import Pack
from .production import Predictor
from ..types import data_type
But after all, this is not a strict constraint so everything will be fine as long as it 'looks good'🤣
In carefree-learn
, we've divided implementations into two parts: the Modules
part and the Models
part. Basically, we construct various Modules
to form our final Models
.
For modules, carefree-learn
continue to divide them into two sections: the basic Blocks
and pipe
related ones. Basically, a pipe
is constructed by transform
, extractor
and head
, and each of them may utilize one of the Blocks
.
- Please refer to Common Blocks for detailed design principles.
- Please refer to
pipe
for detailed design principles. - Please refer to
Customizing New Modules
for how to implement newextractor
and newhead
.
:::tip
It is recommended to follow the implementation style in carefree-learn
to make new implementations:
- For
extractor
, please refer to the rnn implementation. - For
head
, please refer to the fcnn implementation. :::
For models, carefree-learn
will leverage existing Modules
to construct them. Please refer to Constructing Existing Modules to see what's going under the hood and how could we implement new models.
When you are ready to create a pull request, please try to keep the following in mind.
The title of your pull request should
- briefly describe and reflect the changes
- wrap any code with backticks
The description of your pull request should
- describe the motivation
- describe the changes
- if still work-in-progress, describe remaining tasks