Skip to content

add new OTFM example#678

Open
zsteve wants to merge 5 commits intoott-jax:mainfrom
zsteve:sdfmdemo
Open

add new OTFM example#678
zsteve wants to merge 5 commits intoott-jax:mainfrom
zsteve:sdfmdemo

Conversation

@zsteve
Copy link
Copy Markdown
Contributor

@zsteve zsteve commented Mar 5, 2026

I'm putting together a simple demo, this is similar to the existing OTFM tutorial but perhaps shows the distinction between IFM/OTFM/SDFM more clearly. I've realized that some of the basic functionalities (vector field, dataloaders, etc.) are also implemented as part of OTT so need to fix that at some point.

download.mp4

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.35%. Comparing base (25639b6) to head (0cc0b24).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #678   +/-   ##
=======================================
  Coverage   87.35%   87.35%           
=======================================
  Files          82       82           
  Lines        8476     8476           
  Branches      581      581           
=======================================
  Hits         7404     7404           
  Misses        922      922           
  Partials      150      150           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcocuturi
Copy link
Copy Markdown
Contributor

i like this a lot! thanks

can you make sure the linter is happy?

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app bot commented Mar 15, 2026

View / edit / reply to this conversation on ReviewNB

marcocuturi commented on 2026-03-15T10:27:23Z
----------------------------------------------------------------

use the citation format that we use in ott-jax and add citations to reference.bib


@review-notebook-app
Copy link
Copy Markdown

review-notebook-app bot commented Mar 15, 2026

View / edit / reply to this conversation on ReviewNB

marcocuturi commented on 2026-03-15T10:27:23Z
----------------------------------------------------------------

Line #4.    class MLP(nn.Module):

isn't this model class already implemented within the toolbox?


@review-notebook-app
Copy link
Copy Markdown

review-notebook-app bot commented Mar 15, 2026

View / edit / reply to this conversation on ReviewNB

marcocuturi commented on 2026-03-15T10:27:24Z
----------------------------------------------------------------

Line #28.    def step(v_params, key: jax.Array, x0: jax.Array, x1: jax.Array):

same, shouldn't we use the toolbox implementation? if something is missing, can we consider changing it there?


@review-notebook-app
Copy link
Copy Markdown

review-notebook-app bot commented Mar 15, 2026

View / edit / reply to this conversation on ReviewNB

marcocuturi commented on 2026-03-15T10:27:25Z
----------------------------------------------------------------

Line #15.    def solve_semidiscrete(

can't we jit the solver and do away with this helper function? since the logic is only instantiating the geom + using Semidiscretesolver. @michalk8 might have a different opinion


zsteve commented on 2026-03-19T00:36:12Z
----------------------------------------------------------------

agreed!

@review-notebook-app
Copy link
Copy Markdown

review-notebook-app bot commented Mar 15, 2026

View / edit / reply to this conversation on ReviewNB

marcocuturi commented on 2026-03-15T10:27:25Z
----------------------------------------------------------------

cool :)


@review-notebook-app
Copy link
Copy Markdown

review-notebook-app bot commented Mar 15, 2026

View / edit / reply to this conversation on ReviewNB

marcocuturi commented on 2026-03-15T10:27:26Z
----------------------------------------------------------------

Line #2.    def _pair(x0: jax.Array, x1: jax.Array, aux, what: str):

can we consider having three pair functions in a dictionary (with keys = your strings) rather than using string values and aux arguments to fork a single function?


zsteve commented on 2026-03-19T00:36:36Z
----------------------------------------------------------------

I've switched to setting up different dataloaders for this instead.

Copy link
Copy Markdown
Contributor Author

zsteve commented Mar 19, 2026

agreed!


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor Author

zsteve commented Mar 19, 2026

I've switched to setting up different dataloaders for this instead.


View entire conversation on ReviewNB

@zsteve zsteve marked this pull request as ready for review March 19, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants