Skip to content
Open
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
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# comment
name: MyST GitHub Pages Deploy
on:
push:
# Runs on pushes targeting the default branch
branches: [main, dev]
env:
BASE_URL: /${{ github.event.repository.name }}

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install MyST Markdown
run: npm install -g mystmd
- name: Build HTML Assets
run: myst build --html
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "./_build/html"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
159 changes: 159 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
\.ipynb_checkpoints/

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# exclude data from source control by default
datasets/*
!datasets/.gitkeep
*.npz
\outputs
\multirun
**/outputs/*
**/multirun/*
\wandb/
\checkpoints/
notebooks/*.gif
*.mp4
*.png
*.nc
*.pickle
*.pkl
*.ckpt
\lightning_logs/
*.nc
*.zarr
*.npy
*credentials.*
*.pth
\.idea/
.DS_Store
.vscode/settings.json
\jbook/_build/
\_build/
*.keras
Empty file added .project-root
Empty file.
71 changes: 71 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.PHONY: help install_mamba install_macos install_linux update_macos update_linux
.DEFAULT_GOAL = help

PYTHON = python
VERSION = 3.8
NAME = py_name
ROOT = ./
PIP = pip
CONDA = conda
SHELL = bash
PKGROOT = nerf4ssh
TESTS = ${PKGROOT}/nerf4ssh
ENVS = ${PKGROOT}/environments

help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)



##@ Installation
install_mamba: ## Install mamba in base environment
conda install mamba -n base

install_macos: ## Install conda env in MACOS
mamba env create -f ${ENVS}/macos.yaml

install_linux: ## Install conda env in Linux
mamba env create -f ${ENVS}/linux.yaml

update_macos: ## Update conda env in MACOS
mamba env update -f ${ENVS}/macos.yaml

update_linux: ## Update conda env in linux
mamba env update -f ${ENVS}/linux.yaml

install_precommit: ## Install precommit tools
mamba install pre-commit -c conda-forge
pre-commit install

##@ Formatting
black: ## Format code in-place using black.
black ${PKGROOT}/ ${TESTS} -l 79 .

isort: ## Format imports in-place using isort.
isort ${PKGROOT}/ ${TESTS}

format: ## Code styling - black, isort
black ${PKGROOT}/ ${TESTS} -l 79 .
@printf "\033[1;34mBlack passes!\033[0m\n\n"
isort ${PKGROOT}/ ${TESTS}
@printf "\033[1;34misort passes!\033[0m\n\n"

##@ Testing
test: ## Test code using pytest.
@printf "\033[1;34mRunning tests with pytest...\033[0m\n\n"
pytest -v ${PKGROOT}/ ${TESTS}
@printf "\033[1;34mPyTest passes!\033[0m\n\n"

##@ JupyterBook
jb_build: ## Build Jupyterbook
rm -rf docs/_build/
jupyter-book build jbook --all

jb_clean: ## Clean JupyterBook
jupyter-book clean jbook

jb_publish: ## Clean JupyterBook
ghp-import -n -p -f _build/html

run_versioneer: ## run the versioneer software
versioneer install --vendor
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,45 @@ cd nerf4ssh
mamba env create -f environments/linux.yaml
```

### `pip`

```bash
pip install "git+https://github.com/jejjohnson/nerf4ssh.git"
```

### `poetry`

```bash
git clone https://github.com/jejjohnson/nerf4ssh.git
cd nerf4ssh
mamba create -n nerf4ssh python=3.10 poetry
poetry install
```


## External Packages

I use quite a few of external packages that I've relegated to their own repo.

**Neural Fields** - This package has all of the NerF algorithms I use for the experiments.
**Neural Fields**

I use the [`eqx-nerf`](https://github.com/jejjohnson/eqx-nerf) package has all of the NerF algorithms.

```bash
pip install "git+https://github.com/jejjohnson/eqx-nerf.git"
```

**Trainer** - This package has the NN Trainer and logging that I use for this experiment.
**Trainer**

I use the [`eqx-trainer`](https://github.com/jejjohnson/eqx-trainer) package for the NN Trainer and logging.

```bash
pip install "git+https://github.com/jejjohnson/eqx-trainer.git"
```

**OceanBench**

**OceanBench** - This package has the datasets and metrics that I use for this paper.
I use the [`OceanBench`](+https://github.com/jejjohnson/oceanbench) framework for the SSH datasets and metrics.

```bash
brew install g++ cmake eigen boost gsl
Expand Down
35 changes: 35 additions & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Table of Contents
#
# Myst will respect:
# 1. New pages
# - file: relative/path/to/page
# 2. New sections without an associated page
# - title: Folder Title
# sections: ...
# 3. New sections with an associated page
# - file: relative/path/to/page
# sections: ...
#
# Note: Titles defined on pages here are not recognized.
#
# This spec is based on the JupyterBook table of contents.
# Learn more at https://jupyterbook.org/customize/toc.html

format: jb-book
root: content/overview
chapters:
- title: Paper
sections:
- file: content/paper/1_introduction
- file: content/paper/2_methods
- file: content/paper/3_exp1_toy
- file: content/paper/4_exp2_osse
- file: content/paper/5_exp3_ose
- file: content/paper/6_conclusions
- title: Tutorials
sections:
- file: content/tutorials/1.1_naive_nerfs
- file: content/tutorials/1.2_spatial
- file: content/tutorials/1.3_spatiotemporal
- file: content/tutorials/2.1_osse_nadir
- file: content/tutorials/2.2_osse_nadirswot
Empty file added config/data/default.yaml
Empty file.
Empty file added config/data/ose_gf_2017.yaml
Empty file.
Empty file added config/data/osse_gf_2012.yaml
Empty file.
Empty file added config/domain/gulfstream.yaml
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added config/logger/default.yaml
Empty file.
10 changes: 10 additions & 0 deletions config/logger/wandb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
_target_: pytorch_lightning.loggers.WandbLogger
mode: "offline"
save_dir: "/gpfsscratch/rech/cli/uvo53rl"
entity: "ige"
project: "jax4eo"
id: null
prefix: ""
group: ""
tags: []
job_type: ""
1 change: 1 addition & 0 deletions config/lr_scheduler/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scheduler: null
6 changes: 6 additions & 0 deletions config/lr_scheduler/warmup_cosine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
scheduler:
_target_: optax.warmup_cosine_decay_schedule
init_value: 0
peak_value: 1e0
warmup_steps: 25
end_value: 1e-5
12 changes: 12 additions & 0 deletions config/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# @package _global_

defaults:
- _self_
- data: default.yaml
- domain: gulfstream.yaml
- experiment: ose_gf_2017.yaml
- model: siren.yaml
- optimizer: adam
- paths: default.yaml
- period: default.yaml
- preprocess: default.yaml
Loading