Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c1c8168
update optimization
awaelchli Mar 13, 2023
0504638
update inception
awaelchli Mar 13, 2023
da590db
update attention
awaelchli Mar 13, 2023
ec3d50a
incomplete GNN
awaelchli Mar 13, 2023
0b92f1d
update energy models
awaelchli Mar 13, 2023
a5466e4
update deep autoencoders
awaelchli Mar 13, 2023
88722ac
normalizing flows incomplete
awaelchli Mar 13, 2023
47f1cfe
autoregressive
awaelchli Mar 13, 2023
cfab2ee
vit
awaelchli Mar 13, 2023
b4d7be3
meta learning
awaelchli Mar 13, 2023
8ab731c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 13, 2023
18c2430
Apply suggestions from code review
awaelchli Mar 13, 2023
000c803
update gnn
awaelchli Mar 13, 2023
3824605
simclr
awaelchli Mar 13, 2023
d1a93e7
update
awaelchli Mar 13, 2023
6e04b38
Merge branch 'upgrade/course' of github.com:Lightning-AI/tutorials in…
awaelchli Mar 13, 2023
9377298
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 13, 2023
b24b122
Update course_UvA-DL/05-transformers-and-MH-attention/Transformers_MH…
awaelchli Mar 13, 2023
099c50a
update
awaelchli Mar 13, 2023
82f2be6
links
awaelchli Mar 13, 2023
a6a1a17
Merge branch 'main' into upgrade/course
Borda Mar 14, 2023
5733cc0
Merge branch 'main' into upgrade/course
Borda Mar 14, 2023
28accf9
2.0.0rc0
Borda Mar 14, 2023
10615e9
lightning
Borda Mar 14, 2023
217be55
2.0
Borda Mar 14, 2023
1dc811a
Apply suggestions from code review
awaelchli Mar 14, 2023
bb1e40a
docs build fix
awaelchli Mar 14, 2023
835a628
stupid sphinx
awaelchli Mar 14, 2023
94e6725
Merge branch 'main' into upgrade/course
Borda Mar 14, 2023
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
Next Next commit
update optimization
  • Loading branch information
awaelchli committed Mar 13, 2023
commit c1c81683ba2a13aa36b4d02eb8e1b7044a95b9f1
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: -all
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.14.5
# ---

# %% [markdown]
# <div class="center-wrapper"><div class="video-wrapper"><iframe src="https://www.youtube.com/embed/X5m7bC4xCLY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div></div>
# In the first half of the notebook, we will review different initialization techniques, and go step by step from the simplest initialization to methods that are nowadays used in very deep networks.
Expand All @@ -15,7 +27,7 @@

import matplotlib.pyplot as plt
import numpy as np
import pytorch_lightning as pl
import lightning as L
import seaborn as sns
import torch
import torch.nn as nn
Expand All @@ -33,7 +45,7 @@
sns.set()

# %% [markdown]
# Instead of the `set_seed` function as in Tutorial 3, we can use PyTorch Lightning's build-in function `pl.seed_everything`.
# Instead of the `set_seed` function as in Tutorial 3, we can use Lightning's build-in function `L.seed_everything`.
# We will reuse the path variables `DATASET_PATH` and `CHECKPOINT_PATH` as in Tutorial 3.
# Adjust the paths if necessary.

Expand All @@ -44,7 +56,7 @@
CHECKPOINT_PATH = os.environ.get("PATH_CHECKPOINT", "saved_models/InitOptim/")

# Seed everything
pl.seed_everything(42)
L.seed_everything(42)

# Ensure that all operations are deterministic on GPU (if used) for reproducibility
torch.backends.cudnn.determinstic = True
Expand Down Expand Up @@ -938,7 +950,9 @@ def plot_curve(
curve_fn, x_range=(-5, 5), y_range=(-5, 5), plot_3d=False, cmap=cm.viridis, title="Pathological curvature"
):
fig = plt.figure()
ax = fig.gca(projection="3d") if plot_3d else fig.gca()
ax = fig.gca()
if plot_3d:
ax = fig.add_subplot(projection='3d')

x = torch.arange(x_range[0], x_range[1], (x_range[1] - x_range[0]) / 100.0)
y = torch.arange(y_range[0], y_range[1], (y_range[1] - y_range[0]) / 100.0)
Expand Down