-
Notifications
You must be signed in to change notification settings - Fork 195
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 #102 from tum-pbs/2.3-develop
2.3
- Loading branch information
Showing
115 changed files
with
35,648 additions
and
6,758 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
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 |
---|---|---|
|
@@ -33,7 +33,9 @@ jobs: | |
run: pdoc --html --output-dir docs --force phi | ||
|
||
- name: Build static HTML for Jupyter Notebooks | ||
run: jupyter nbconvert --to html --execute --allow-errors docs/*.ipynb | ||
run: | | ||
jupyter nbconvert --to html --execute --allow-errors docs/*.ipynb | ||
jupyter nbconvert --to html --output-dir docs/ docs/prerendered/*.ipynb | ||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] # See https://github.com/marketplace/actions/deploy-to-github-pages | ||
|
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
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,29 @@ | ||
import math | ||
from phi.torch.flow import * | ||
net = invertible_net(1, 3, True, 'u_net', 'SiLU') | ||
optimizer = adam(net, learning_rate=1e-3) | ||
|
||
print(parameter_count(net)) | ||
|
||
def loss_function(smoothness: Tensor): | ||
grid = CenteredGrid(Noise(smoothness=smoothness), x=8, y=8) | ||
pred_smoothness = field.native_call(net, grid) | ||
|
||
return math.l2_loss(pred_smoothness - smoothness) | ||
|
||
gt_smoothness = math.random_uniform(batch(examples=10), low=0.5, high=1) | ||
|
||
viewer = view(gui='dash', scene=True) | ||
for i in viewer.range(): | ||
if i > 100: break | ||
loss = update_weights(net, optimizer, loss_function, gt_smoothness) | ||
if i % 10 == 0: print(f'Iter : {i}, Loss : {loss}') | ||
viewer.log_scalars(loss=loss) | ||
|
||
grid = CenteredGrid(Noise(scale=1.0, smoothness=gt_smoothness), x=8, y=8) | ||
pred = field.native_call(net, grid, False) | ||
reconstructed_input = field.native_call(net, pred, True) | ||
|
||
print('Loss between Predicted Tensor and original grid', math.l2_loss(pred - grid)) | ||
print('Loss between Predicted Tensor and GT tensor', math.l2_loss(pred - gt_smoothness)) | ||
print('Loss between Reconstructed Input and original grid:', math.l2_loss(reconstructed_input - grid)) |
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
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
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
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
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
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
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
Oops, something went wrong.