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

Fixing warnings from Sphinx/JupyterBook #90

Merged
merged 4 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
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 deepsensor/active_learning/acquisition_fns.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(
context_set_idx (int):
Index of context set to add new observations to when computing
the acquisition function.
target_set_idx (int):
target_set_idx (int):
Index of target set to compute acquisition function for.
"""
self.model = model
Expand Down
2 changes: 1 addition & 1 deletion deepsensor/data/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TaskLoader:
- If all data passed as paths, load the data and overwrite the paths with the loaded data
- Either all data is passed as paths, or all data is passed as loaded data (else ``ValueError``)
- If all data passed as paths, the TaskLoader can be saved with the ``save`` method
(using config)
(using config)

Args:
task_loader_ID:
Expand Down
24 changes: 9 additions & 15 deletions deepsensor/data/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ def summarise_repr(cls, k, v) -> str:
Value of the task dictionary.

Returns:
str:
String representation of the task.
str: String representation of the task.
"""
if v is None:
return "None"
Expand Down Expand Up @@ -357,14 +356,10 @@ def append_obs_to_task(
option plus ability to remove observations.

Args:
task (:class:`deepsensor.data.task.Task`:):
The task to modify.
X_new (array-like):
New observation coordinates.
Y_new (array-like):
New observation values.
context_set_idx (int):
Index of the context set to append to.
task (:class:`deepsensor.data.task.Task`:): The task to modify.
X_new (array-like): New observation coordinates.
Y_new (array-like): New observation values.
context_set_idx (int): Index of the context set to append to.

Returns:
:class:`deepsensor.data.task.Task`:
Expand Down Expand Up @@ -459,15 +454,14 @@ def concat_tasks(tasks: List[Task], multiple: int = 1) -> Task:
the computational graph in graph mode.

Returns:
:class:`~.data.task.Task`
Task containing multiple batches.
:class:`~.data.task.Task`: Task containing multiple batches.

Raises:
ValueError
ValueError:
If the tasks have different numbers of target sets.
ValueError
ValueError:
If the tasks have different numbers of targets.
ValueError
ValueError:
If the tasks have different types of target sets (gridded/
non-gridded).
"""
Expand Down
13 changes: 9 additions & 4 deletions deepsensor/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def task(

with plt.rc_context(params):
fig, axes = plt.subplots(
nrows=nrows, ncols=ncols, figsize=(ncols * figsize, nrows * figsize)
nrows=nrows,
ncols=ncols,
figsize=(ncols * figsize, nrows * figsize),
)
if nrows == 1:
axes = axes[np.newaxis]
Expand Down Expand Up @@ -303,7 +305,8 @@ def offgrid_context(
colors: Optional[str] = None,
**scatter_kwargs,
) -> None:
"""Plot the off-grid context points on ``axes``.
"""
Plot the off-grid context points on ``axes``.

Uses a provided :class:`~.data.processor.DataProcessor` to unnormalise the
context coordinates if provided.
Expand Down Expand Up @@ -334,7 +337,7 @@ def offgrid_context(
Additional keyword arguments to pass to the scatter plot.

Returns:
None.
None
"""
if markers is None:
# all matplotlib markers
Expand Down Expand Up @@ -1018,7 +1021,9 @@ def prediction(

# rotate date times
ax.set_xticklabels(
ax.get_xticklabels(), rotation=45, horizontalalignment="right"
ax.get_xticklabels(),
rotation=45,
horizontalalignment="right",
)

ax.set_title(f"{var_ID} {param}")
Expand Down
6 changes: 6 additions & 0 deletions docs/research_ideas.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Why not [join our Slack channel](https://docs.google.com/forms/d/e/1FAIpQLScsI8E
and start a conversation around these ideas or your own? :-)

## Transfer learning from regions of dense observations to regions of sparse observations

Since the `ConvNP` is a data-hungry model, it does not perform well if only trained on a
small number of observations, which presents a challenge for modelling variables that
are poorly observed.
Expand All @@ -20,19 +21,22 @@ of sparse observations?
Does the performance improve?

## Sensor placement for forecasting

Previous active learning research with ConvNPs has only considered sensor placement for interpolation.
Do the sensor placements change when the model is trained for forecasting?

See, e.g., Section 4.2.1 of [Environmental sensor placement with convolutional Gaussian neural processes](https://doi.org/10.1017/eds.2023.22).

## U-Net architectural changes

The `ConvNP` currently uses a vanilla U-Net architecture.
Do any architectural changes improve performance, such as batch normalisation or dropout?

This would require digging into the [`neuralprocesses.construct_convgnp` method](https://github.com/wesselb/neuralprocesses/blob/f20572ba480c1279ad5fb66dbb89cbc73a0171c7/neuralprocesses/architectures/convgnp.py#L97)
and replacing the U-Net module with a custom one.

## Extension to continuous time observations

The `ConvNP` currently assumes that the observations are on a regular time grid.
How can we extend this to continuous time observations, where the observations are not necessarily
on a regular time grid?
Expand All @@ -41,6 +45,7 @@ For example, can we pass a 'time of observation' auxiliary input to the model?
What are the limitations of this approach?

## Training with ablations for interpretability

Since the `ConvNP` operates on sets of observations, it is possible to ablate observations
and see how the model's predictions change.
Thus, the `ConvNP` admits unique interpretability opportunities.
Expand All @@ -53,6 +58,7 @@ Then, at test time, ablate context sets and measure the change in the model's pr
or performance.

## Monte Carlo sensor placement using AR sampling

The `GreedyAlgorithm` for sensor placement currently uses the model's mean prediction
to infill missing observations at query sites.
However, one could also draw multiple [AR samples](user-guide/prediction.ipynb)
Expand Down
Loading