forked from cog-imperial/OMLT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from jezsadler/main
Merging in Keras 3 etc
- Loading branch information
Showing
62 changed files
with
2,778 additions
and
1,746 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["main","github-actions"] | ||
pull_request: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tests: | ||
name: "Python ${{ matrix.python-version }}" | ||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
# python-version: ["3.7", "3.8", "3.9"] | ||
python-version: ["3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
- uses: "actions/checkout@v2" | ||
- uses: "actions/setup-python@v2" | ||
- uses: "s-weigand/setup-conda@v1" | ||
with: | ||
python-version: "${{ matrix.python-version }}" | ||
|
||
- name: Install solvers | ||
run: sudo apt-get install -y glpk-utils coinor-cbc | ||
|
||
- name: "Install dependencies" | ||
run: | | ||
set -xe | ||
python -VV | ||
python -m site | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions | ||
conda install -c conda-forge ipopt | ||
conda install -c conda-forge pyscipopt | ||
- name: "Run tox targets with lean testing environment for ${{ matrix.python-version }}" | ||
run: "tox -re leanenv" | ||
|
||
- name: "Run tox targets for ${{ matrix.python-version }}" | ||
run: "tox" | ||
|
||
# - name: "Run tox notebooks targets for ${{ matrix.python-version }}" | ||
# run: | | ||
# shopt -s globstar | ||
# tox -e notebooks docs/**/*.ipynb | ||
|
||
- name: "Convert coverage" | ||
run: "python -m coverage xml" | ||
|
||
- name: "Upload coverage to Codecov" | ||
uses: "codecov/codecov-action@v2" | ||
with: | ||
fail_ci_if_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,4 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
.vscode/settings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
from random import random | ||
|
||
import numpy as np | ||
import pandas as pd | ||
from random import random | ||
|
||
n_samples = 10000 | ||
w = 5 | ||
|
||
x = np.linspace(-2,2,n_samples) | ||
df = pd.DataFrame(x, columns=['x']) | ||
df['y'] = np.sin(w*x) + x**2 + np.array([np.random.uniform()*0.1 for _ in range(n_samples)]) | ||
x = np.linspace(-2, 2, n_samples) | ||
df = pd.DataFrame(x, columns=["x"]) | ||
df["y"] = ( | ||
np.sin(w * x) | ||
+ x**2 | ||
+ np.array([np.random.uniform() * 0.1 for _ in range(n_samples)]) | ||
) | ||
|
||
plt.plot(df['x'],df['y']) | ||
plt.plot(df["x"], df["y"]) | ||
plt.show() | ||
|
||
df.to_csv("sin_quadratic.csv") | ||
df.to_csv("sin_quadratic.csv") |
256 changes: 134 additions & 122 deletions
256
docs/notebooks/neuralnet/auto-thermal-reformer-relu.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
236 changes: 112 additions & 124 deletions
236
docs/notebooks/neuralnet/graph_neural_network_formulation.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.