Skip to content

Phase 6: CoreML + TFLite export, GH Release publishing, CBRFC archive#12

Merged
tmart234 merged 1 commit into
devfrom
claude/review-openflow-mobile-Vf4rQ
May 18, 2026
Merged

Phase 6: CoreML + TFLite export, GH Release publishing, CBRFC archive#12
tmart234 merged 1 commit into
devfrom
claude/review-openflow-mobile-Vf4rQ

Conversation

@tmart234

Copy link
Copy Markdown
Owner

The training pipeline produced a Keras .h5 that the mobile app had no
durable way to consume: the GH Actions artifact had a 7-day retention and
no CoreML/TFLite conversion existed in this repo. Add an export_mobile
module that converts the .h5 to .mlpackage (CoreML for iOS) and .tflite
(Android) with sha256 + schema manifest, and have ml_training.yml publish
a tagged GitHub Release per successful train so the mobile app has a
stable fetch URL.

TFLite has three conversion tiers (strict builtins -> Flex delegate ->
rebuild without mask_zero) to handle the dual Embedding(mask_zero=True)

  • LSTM-with-initial_state graph; the winning tier is recorded in
    manifest.json so consumers know whether they need the select-tf-ops AAR.

Also finish the CBRFC historical baseline by hitting the NWS NWPS forecast
archive (api.water.noaa.gov) with a reference_time, replacing the empty
stub used for any anchor < today. The LID map is externalized to a JSON
file so wiring a new gauge is data, not code.

docs/INFERENCE.md is the contract: input tensor shapes, scaler inversion,
output decoding, Flex delegate note. Mobile devs should not need to read
train.py to ship.

https://claude.ai/code/session_01XfhRQmztLSqmz6qeLSi9kw

The training pipeline produced a Keras .h5 that the mobile app had no
durable way to consume: the GH Actions artifact had a 7-day retention and
no CoreML/TFLite conversion existed in this repo. Add an export_mobile
module that converts the .h5 to .mlpackage (CoreML for iOS) and .tflite
(Android) with sha256 + schema manifest, and have ml_training.yml publish
a tagged GitHub Release per successful train so the mobile app has a
stable fetch URL.

TFLite has three conversion tiers (strict builtins -> Flex delegate ->
rebuild without mask_zero) to handle the dual Embedding(mask_zero=True)
+ LSTM-with-initial_state graph; the winning tier is recorded in
manifest.json so consumers know whether they need the select-tf-ops AAR.

Also finish the CBRFC historical baseline by hitting the NWS NWPS forecast
archive (api.water.noaa.gov) with a reference_time, replacing the empty
stub used for any anchor < today. The LID map is externalized to a JSON
file so wiring a new gauge is data, not code.

docs/INFERENCE.md is the contract: input tensor shapes, scaler inversion,
output decoding, Flex delegate note. Mobile devs should not need to read
train.py to ship.

https://claude.ai/code/session_01XfhRQmztLSqmz6qeLSi9kw
@tmart234 tmart234 merged commit f3e8139 into dev May 18, 2026
2 of 3 checks passed
@tmart234 tmart234 deleted the claude/review-openflow-mobile-Vf4rQ branch May 18, 2026 17:20
Comment on lines +21 to +37
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r openFlowML/requirements.txt
pip install pytest

- name: Run mobile export parity tests
run: python -m pytest -v tests/test_export_parity.py
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.

3 participants