Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dref360 committed Jun 7, 2024
1 parent a0d6d3e commit 5cf6761
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion baal/active/active_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from . import heuristics
from .dataset import ActiveLearningDataset

log = structlog.get_logger('baal')
log = structlog.get_logger("baal")
pjoin = os.path.join


Expand Down
2 changes: 1 addition & 1 deletion baal/active/heuristics/stochastics.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from baal.active.heuristics import AbstractHeuristic, Sequence

log = structlog.get_logger('baal')
log = structlog.get_logger("baal")
EPSILON = 1e-8


Expand Down
12 changes: 7 additions & 5 deletions baal/experiments/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
TransformersAdapter = None # type: ignore
TRANSFORMERS_AVAILABLE = False

log = structlog.get_logger('baal')
log = structlog.get_logger("baal")


class ActiveLearningExperiment:
Expand Down Expand Up @@ -78,10 +78,12 @@ def start(self):
"No item labelled in the training set."
" Did you run `ActiveLearningDataset.label_randomly`?"
)
for _ in tqdm(itertools.count(start=0), # Infinite counter to rely on Criterion
desc="Active Experiment",
# Upper bound estimation.
total=np.round(self.al_dataset.n_unlabelled // self.query_size)):
for _ in tqdm(
itertools.count(start=0), # Infinite counter to rely on Criterion
desc="Active Experiment",
# Upper bound estimation.
total=np.round(self.al_dataset.n_unlabelled // self.query_size),
):
self.adapter.reset_weights()
train_metrics = self.adapter.train(self.al_dataset)
eval_metrics = self.adapter.evaluate(
Expand Down
4 changes: 1 addition & 3 deletions baal/modelwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class ModelWrapper(MetricMixin):
Args:
model (nn.Module): The model to optimize.
criterion (Callable): A loss function.
replicate_in_memory (bool): Replicate in memory optional.
args (TrainingArgs): Model arguments for training/predicting.
"""

def __init__(self, model, args: TrainingArgs):
Expand Down Expand Up @@ -149,7 +148,6 @@ def train_and_test_on_datasets(
Args:
train_dataset (Dataset): Dataset to train on.
test_dataset (Dataset): Dataset to evaluate on.
optimizer (Optimizer): Optimizer to use during training.
return_best_weights (bool): If True, will keep the best weights and return them.
patience (Optional[int]): If provided, will use early stopping to stop after
`patience` epoch without improvement.
Expand Down
5 changes: 4 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ To know more on what is Bayesian active learning, see our [User guide](user_guid

We are a member of Pytorch's ecosystem, and we welcome contributions from the community.

!!! tip "Baal 2.0 !"
Baal is now version 2.0! We made a lot of changes to make everyone life easier!
See our [Release Note](https://github.com/baal-org/baal/releases/tag/v2.0.0) for details.

::cards:: cols=2
- title: User Guide
content: |
Expand Down Expand Up @@ -46,4 +50,3 @@ Baal is available as a package on PyPI:
`baal[nlp]` installs needed dependencies for HuggingFace support.

`baal[vision]` installs dependencies for our Lightning-Flash integration.

2 changes: 1 addition & 1 deletion docs/learn/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ We hope that work in this area continues so that we can better understand the im

**Resources**

* [Literature review](/literature/index.md)
* [Literature review](./literature/index.md)
* [Active learning dataset and training loop classes](../notebooks/fundamentals/active-learning)
* [Methods for approximating bayesian posteriors](../notebooks/fundamentals/posteriors)
* [Full active learning example](../notebooks/active_learning_process)
Expand Down
2 changes: 1 addition & 1 deletion experiments/pytorch_lightning/lightning_flash_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from baal.active import get_heuristic

log = structlog.get_logger('baal')
log = structlog.get_logger("baal")

IMG_SIZE = 128

Expand Down

0 comments on commit 5cf6761

Please sign in to comment.