Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hugging Face and MONAI as hubs for pretrained models #474

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion episodes/2-keras.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
The `palmerpenguins` data contains size measurements for three penguin species observed on three islands in the Palmer Archipelago, Antarctica.
The physical attributes measured are flipper length, beak length, beak width, body mass, and sex.

![*Artwork by @allison_horst*][palmer-penguins]

Check warning on line 79 in episodes/2-keras.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/palmer_penguins.png


![*Artwork by @allison_horst*][penguin-beaks]

Check warning on line 82 in episodes/2-keras.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/culmen_depth.png


These data were collected from 2007 - 2009 by Dr. Kristen Gorman with the [Palmer Station Long Term Ecological Research Program](https://pal.lternet.edu/), part of the [US Long Term Ecological Research Network](https://lternet.edu/). The data were imported directly from the [Environmental Data Initiative](https://environmentaldatainitiative.org/) (EDI) Data Portal, and are available for use by CC0 license ("No Rights Reserved") in accordance with the [Palmer Station Data Policy](https://pal.lternet.edu/data/policies).
Expand Down Expand Up @@ -140,7 +140,7 @@
sns.pairplot(penguins, hue="species")
```

![][pairplot]

Check warning on line 143 in episodes/2-keras.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/pairplot.png

::: challenge

Expand All @@ -165,7 +165,7 @@
sns.pairplot(penguins, hue='sex')
```

![][sex_pairplot]

Check warning on line 168 in episodes/2-keras.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/02_sex_pairplot.png

You see that for each species females have smaller bills and flippers, as well as a smaller body mass.
You would need a combination of the species and the numerical features to successfully distinguish males from females.
Expand Down Expand Up @@ -464,7 +464,7 @@
### Choose a pretrained model
If your data and problem is very similar to what others have done, you can often use a *pretrained network*.
Even if your problem is different, but the data type is common (for example images), you can use a pretrained network and finetune it for your problem.
A large number of openly available pretrained networks can be found in the [Model Zoo](https://modelzoo.co/), [pytorch hub](https://pytorch.org/hub/) or [tensorflow hub](https://www.tensorflow.org/hub/).
A large number of openly available pretrained networks can be found on [Hugging Face](https://huggingface.co/models) (especially LLMs), [MONAI](https://monai.io/) (medical imaging), the [Model Zoo](https://modelzoo.co/), [pytorch hub](https://pytorch.org/hub/) or [tensorflow hub](https://www.tensorflow.org/hub/).


## 5. Choose a loss function and optimizer
Expand Down Expand Up @@ -524,7 +524,7 @@
```python
sns.lineplot(x=history.epoch, y=history.history['loss'])
```
![][training_curve]

Check warning on line 527 in episodes/2-keras.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/02_training_curve.png

This plot can be used to identify whether the training is well configured or whether there
are problems that need to be addressed.
Expand All @@ -543,7 +543,7 @@

3. (optional) Something went wrong here during training. What could be the problem, and how do you see that in the training curve?
Also compare the range on the y-axis with the previous training curve.
![](../fig/02_bad_training_history_1.png){alt='Very jittery training curve with the loss value jumping back and forth between 2 and 4. The range of the y-axis is from 2 to 4, whereas in the previous training curve it was from 0 to 2. The loss seems to decrease a litle bit, but not as much as compared to the previous plot where it dropped to almost 0. The minimum loss in the end is somewhere around 2.'}

Check warning on line 546 in episodes/2-keras.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing file]: [](../fig/02_bad_training_history_1.png)

:::: solution
## Solution
Expand Down Expand Up @@ -683,7 +683,7 @@
```python
sns.heatmap(confusion_df, annot=True)
```
![][confusion_matrix]

Check warning on line 686 in episodes/2-keras.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[image missing alt-text]: fig/confusion_matrix.png

::: challenge
## Confusion Matrix
Expand Down
Loading