-
Notifications
You must be signed in to change notification settings - Fork 70
First draft of Transfer Learning User Guide #140
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9f24f0e
First draf of Transfer Learning User Guide
AVHopp 8cad444
Improve admonition on terminology
AVHopp 962acff
Add examples for cell lines
AVHopp 82d130e
Add link to and explanation of example
AVHopp 2836729
Update CHANGELOG.md
AVHopp 98eae5d
Format code blocks
AVHopp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,4 +1,88 @@ | ||
| # Transfer Learning | ||
|
|
||
| This page will soon contain information about transfer learning. | ||
| In the meantime, please see the [examples](../../examples/examples) instead. | ||
| BayBE offers the possibility to mix data from multiple campaigns in order to accelerate | ||
| optimization. | ||
| Using data from multiple campaigns is currently supported when using a Gaussian Process | ||
| Surrogate model and is implemented by the [`TaskParameter`](baybe.parameters.categorical.TaskParameter). | ||
|
|
||
| ```{admonition} Terminology | ||
| :class: note | ||
| The term "Transfer Learning" is used in a lot of different ways. | ||
| Within BayBE, "Transfer Learning" refers to combining data from multiple campaigns. | ||
| Depending on the field, this might also be known as "contextual learning". | ||
| Further, note that the act of combining the data of several contexts can be done via | ||
| multiple models, shared architectures, special kernels in a single model, etc. | ||
| We do not necessarily want to limit to any of these methods, even though BayBE currently | ||
| offers only a single one. | ||
| ``` | ||
|
|
||
| ## The role of `TaskParameter` | ||
|
|
||
| The `TaskParameter` is used to "mark" the context of an individual experiment. The | ||
| set of all possible contexts is provided upon the initialization of a `TaskParameter` | ||
| by providing them as `values`. | ||
Scienfitz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| In the following example, the context might be one of several reactors in which | ||
| a chemical experiments can be conducted. | ||
|
|
||
| ```python | ||
| from baybe.parameters import TaskParameter | ||
|
|
||
| TaskParameter(name="Reactor", values=["ReactorA", "ReactorB", "ReactorC"]) | ||
| ``` | ||
|
|
||
| If not specified further, a campaign using the `TaskParameter` as specified above | ||
| would now make recommendations for all possible values of the parameter. Using the | ||
| `active_values` argument upon initialization, this behavior can be changed such that | ||
| the `campaign` only makes recommendations for the corresponding values. | ||
|
|
||
| The following example models a situation in which data from experiments in three | ||
| different reactors are available, but new experiments should only be conducted in | ||
| `ReactorC`. | ||
|
|
||
| ```python | ||
| from baybe.parameters import TaskParameter | ||
|
|
||
| TaskParameter( | ||
| name="Reactor", | ||
| values=["ReactorA", "ReactorB", "ReactorC"], | ||
| active_values=["ReactorC"], | ||
| ) | ||
| ``` | ||
|
|
||
| This can be abstracted easily to other scenarios such as changing substrates (while | ||
| screening same reaction conditions) or formulating mixtures for different cell lines: | ||
|
|
||
| ~~~python | ||
| TaskParameter( | ||
| name="Substrate", | ||
| values=["3,5-dimethylisoxazole", "benzo[d]isoxazole", "5-methylisoxazole"], | ||
| active_values=["3,5-dimethylisoxazole"], | ||
| ) | ||
| TaskParameter( | ||
| name="Month", | ||
| values=["Liver cell", "Heart cell", "Hamster brain cell"], | ||
| active_values=["Liver cell"], | ||
| ) | ||
| ~~~ | ||
|
|
||
| ## Seeing Transfer Learning in Action | ||
|
|
||
| We provide full example demonstrating BayBE's transfer learning capabilities. | ||
| We want to briefly discuss and highlight the results of this example in this user guide. | ||
| The full example can be found [here](../../examples/Transfer_Learning/basic_transfer_learning). | ||
|
|
||
| The example optimizes an analytical function, the so-called "Hartmann Function". | ||
| We use transfer learning by providing additional data that was obtained by evaluating a | ||
| negated noisy variant of the same function. | ||
|
|
||
| The following plot demonstrates the effect that providing this additional data has: | ||
|
|
||
| ```{image} ../../examples/Transfer_Learning/basic_transfer_learning_light.svg | ||
| :align: center | ||
| :class: only-light | ||
| ``` | ||
|
|
||
| ```{image} ../../examples/Transfer_Learning/basic_transfer_learning_dark.svg | ||
| :align: center | ||
| :class: only-dark | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.