Skip to content

Commit

Permalink
Merge pull request #118 from mwalmsley/inigo_dev
Browse files Browse the repository at this point in the history
Inigo dev
  • Loading branch information
mwalmsley authored May 30, 2024
2 parents 1517b20 + 9d0bbb3 commit f00f496
Show file tree
Hide file tree
Showing 7 changed files with 494 additions and 363 deletions.
6 changes: 3 additions & 3 deletions docs/guides/finetuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ These files are called checkpoints (like video game save files - computer scient
model = finetune.FinetuneableZoobotClassifier(
name='hf_hub:mwalmsley/zoobot-encoder-convnext_nano', # which pretrained model to download
num_classes=2,
n_layers=0
n_blocks=0
)
You can see the list of pretrained models at :doc:`/pretrained_models`.

What about the other arguments?
When loading the checkpoint, FinetuneableZoobotClassifier will automatically change the head layer to suit a classification problem (hence, ``Classifier``).
``num_classes=2`` specifies how many classes we have, Here, two classes (a.k.a. binary classification).
``n_layers=0`` specifies how many layers (other than the output layer) we want to finetune.
0 indicates no other layers, so we will only be changing the weights of the output layer.
``n_blocks=0`` specifies how many inner blocks (groups of layers, excluding the output layer) we want to finetune.
0 indicates no other blocks, so we will only be changing the weights of the output layer.


Prepare Galaxy Data
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
'albumentations',
'pyro-ppl>=1.8.0',
'torchmetrics==0.11.0',
'timm >= 0.9.10',
'galaxy_datasets == 0.0.17'
'timm >= 0.9.10'
],
# TODO may add narval/Digital Research Canada config
'tensorflow': [ # WARNING now deprecated
Expand Down Expand Up @@ -117,6 +116,6 @@
'webdataset', # for reading webdataset files
'huggingface_hub', # login may be required
'setuptools', # no longer pinned
'galaxy-datasets>=0.0.18' # for dataset loading in both TF and Torch (see github/mwalmsley/galaxy-datasets)
'galaxy-datasets>=0.0.21' # for dataset loading in both TF and Torch (see github/mwalmsley/galaxy-datasets)
]
)
Loading

0 comments on commit f00f496

Please sign in to comment.