Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
115e04d
Test publish (#273)
haneslinger Mar 17, 2023
2321d5c
visualization (timeseries comparison) cleaning (#246)
JanghyunJK Mar 17, 2023
7f95939
adding notebook for processing BDGP2 data (#272)
JanghyunJK Mar 21, 2023
df5428c
UPdate poetry in dockerfile (#277)
haneslinger Apr 11, 2023
844998b
Fix 281 (#285)
haneslinger Jul 27, 2023
258d805
Add prediction notebooks (#288)
haneslinger Aug 11, 2023
0f97334
Remove input_dim from config (#289)
haneslinger Dec 14, 2023
8d04d9f
Bump grpcio from 1.51.1 to 1.53.0 (#282)
dependabot[bot] Dec 14, 2023
fde6239
Bump pygments from 2.14.0 to 2.15.0 (#284)
dependabot[bot] Dec 14, 2023
f43eaa4
Bump tornado from 6.2 to 6.3.3 (#291)
dependabot[bot] Dec 14, 2023
90a4b9e
Bump werkzeug from 2.2.2 to 2.3.8 (#298)
dependabot[bot] Dec 14, 2023
2169b2a
Bump pillow from 9.4.0 to 10.0.1 (#299)
dependabot[bot] Dec 14, 2023
d150a82
Remove Request (#301)
haneslinger Dec 14, 2023
2466d27
Remove Dockerfile (#302)
haneslinger Dec 14, 2023
0dcb374
Rename buildings_processing (#304)
haneslinger Dec 15, 2023
1d1183d
Fix .gitignore (#303)
haneslinger Dec 15, 2023
63d77cc
batch training notebook update (#264)
JanghyunJK Dec 15, 2023
cc12b88
data processing update: bdgp2 (#278)
JanghyunJK Dec 15, 2023
8de7c32
Add alfa ensemble model (#297)
haneslinger Jan 22, 2024
7031ae2
Rename AlgoMainRNNBase.py (#307)
haneslinger Jan 22, 2024
5d3fac9
Update readme (#305)
haneslinger Jan 22, 2024
510c0d8
Update wattile (#312)
haneslinger Jan 23, 2024
da2ee75
Bump black from 22.12.0 to 24.3.0
dependabot[bot] Mar 20, 2024
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
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: publish

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs

- name: Build and publish to pypi
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
24 changes: 13 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
./data
.ipynb_checkpoints/
# python/IDE articfacts
.idea/
.ipynb_checkpoints/
.DS_Store
__pycache__/
Deep_Learning_Prediction_Intervals/
algorithm_implement.py
exp_dir/
data/
!./tests/data/Synthetic Site
nsrd_auth.json
coverage/
dist/

# notebook articfacts
notebooks/examples/exp_dir/
notebooks/examples/Synthetic Site/
notebooks/examples/Training_history.csv
tests/data/Synthetic Site/Synthetic Site Electricity Main Total Power_external_test.h5
tests/fixtures/alfa_exp_dir/events.out.tfevents.*
tests/fixtures/alfa_exp_dir/output.out
Training_history.csv
.DS_Store
.coverage
dist
18 changes: 0 additions & 18 deletions Dockerfile

This file was deleted.

51 changes: 26 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
Wattile
====
=

Deep learning algorithms for probabilistic forecasting of time series building performance data.
Probabilistic Deep Learning-based Forecasting of Building Energy ConsumptionProbabilistic Deep Learning-based Forecasting of Building Energy Consumption.

Set Up
----
# Set Up

Requirements:
- [Python](https://www.python.org/downloads/) >= 3.7.0
- [Poetry](https://python-poetry.org/docs/#installation)
- [Microsoft Visual C++ 14.0](https://visualstudio.microsoft.com/visual-cpp-build-tools/), if you're on Windows

If using conda for python management, use `environment.yml` to make an environment and configure poetry to not create a vitural enviroment.
If using conda for python management, use `environment.yml` to make an environment and configure poetry to not create a vitural enviroment (else, skip these commands).
```
conda env create -f environment.yml
poetry config virtualenvs.create false
Expand All @@ -29,35 +28,27 @@ poetry run pre-commit install

Quick Start
----
Please see [our example notebooks](./notebooks/examples) to see how to run Wattile out of the box.

Wattile has two main functions:
- `create_input_dataframe`, which creates a dataframe for model input from the configs file and raw data.
- `run_model` which runs either training, validation, or prediction on input dataframes according to the configs.

Docs for the configs [here](./docs/Configs.md).

Docs for the format of the raw data is [here](./docs/Data_configs.md).

Docs for the format of the output is [here](./docs/Output.md).

In short, one must prep their data, create the model, and send the data through.
```py
import json

from wattile.entry_point import create_input_dataframe, run_model

with open("wattile/configs.json", "r") as f:
configs = json.load(f)

init_logging(configs["exp_dir"])
train_df, val_df = create_input_dataframe(configs)
run_model(configs, train_df, val_df)
train_df, val_df = prep_for_rnn(configs, data)
model = ModelFactory.create_model(configs)
model.train(train_df, val_df)
```

After running, you may use tensordboard on the results.

```
tensorboard --logdir=<study directory>
```
Wattile is highly configurable.

Docs for the configs [here](./docs/Configs.md).

Docs for the format of the raw data is [here](./docs/Data_configs.md).

Docs for the format of the output is [here](./docs/Output.md).

Available Models
----
Expand All @@ -78,6 +69,16 @@ Available Models
* Vanilla and LSTM variants available
* Supports future time predictions with constant spacing or variable spacing


### [Alfa Ensemble](./wattile/models/alfa_ensemble_model.py)

* Probabilistic forecasting
* In one training session, predict:
* Number of future times: *T*
* Number of quantiles per time: *Q*
* Vanilla and LSTM variants available
* Supports future time predictions with constant spacing or variable spacing

Development
----

Expand Down
2 changes: 1 addition & 1 deletion docs/Vis_TimeseriesComparisons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 15 additions & 15 deletions notebooks/examples/example_batch_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"import os\n",
"from pathlib import Path\n",
"\n",
"from wattile.buildings_processing import prep_for_rnn\n",
"from wattile.data_processing import prep_for_rnn\n",
"from wattile.data_reading import read_dataset_from_file\n",
"from wattile.entry_point import init_logging\n",
"from wattile.models import ModelFactory\n",
Expand Down Expand Up @@ -42,19 +42,6 @@
"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# read configs file for training\n",
"with open(\n",
" PROJECT_DIRECTORY / \"wattile\" / \"configs\" / \"configs.json\", \"r\"\n",
") as f:\n",
" configs = json.load(f)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -73,6 +60,19 @@
" data_dir = entry[\"dir_data\"]\n",
"\n",
" for target in entry[\"targets\"]:\n",
" \n",
" \"\"\"\n",
" read configs file\n",
" \"\"\"\n",
" with open(\n",
" PROJECT_DIRECTORY / \"wattile\" / \"configs\" / \"configs.json\", \"r\"\n",
" ) as f:\n",
" configs = json.load(f)\n",
" \n",
" \"\"\"\n",
" read configs file\n",
" \"\"\"\n",
" # update configs here only if necessary\n",
"\n",
" \"\"\"\n",
" model training\n",
Expand All @@ -85,7 +85,7 @@
" configs[\"data_input\"][\"data_dir\"] = str(PROJECT_DIRECTORY / data_dir)\n",
" configs[\"data_input\"][\"data_config\"] = \"{} Config.json\".format(building)\n",
" configs[\"data_input\"][\"target_var\"] = target\n",
" exp_dir = PROJECT_DIRECTORY / building / target\n",
" exp_dir = PROJECT_DIRECTORY / \"notebooks\" / \"examples\" / building / target\n",
" configs[\"data_output\"][\"exp_dir\"] = str(exp_dir)\n",
"\n",
" # create results folder\n",
Expand Down
Loading