-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2243334
commit f750815
Showing
21 changed files
with
629 additions
and
32 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+4.25 KB
(110%)
docs/build/doctrees/_autosummary/dynadojo.systems.heat.HeatEquation.doctree
Binary file not shown.
Binary file modified
BIN
+16.1 KB
(130%)
docs/build/doctrees/_autosummary/dynadojo.systems.utils.simple.SimpleSystem.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,43 @@ | ||
You can download the source image `here <https://github.com/FlyingWorkshop/dynadojo/blob/main/graphics/dino.png>`_. | ||
|
||
.. code:: python | ||
import numpy as np | ||
from PIL import Image | ||
import matplotlib.pyplot as plt | ||
def grayscale(png_path, basewidth=30): | ||
image = Image.open(png_path) | ||
wpercent = (basewidth / float(image.size[0])) | ||
hsize = int((float(image.size[1]) * float(wpercent))) | ||
image = image.resize((basewidth,hsize), Image.Resampling.LANCZOS) | ||
grayscale_image = image.convert("L") | ||
grey = np.array(grayscale_image) | ||
return grey | ||
dino = grayscale("../graphics/dino.png") | ||
print(dino.shape) | ||
latent_dim = dino.shape[0] ** 2 | ||
plt.imshow(dino, cmap='gray') | ||
plt.axis('off') # Turn off axis labels and ticks | ||
plt.show() | ||
.. image:: ../_images/bw_dino.png | ||
|
||
.. code:: python | ||
from dynadojo.systems.heat import HeatEquation | ||
from dynadojo.wrappers import SystemChecker | ||
from dynadojo.utils.heat import plot | ||
# Create the init conds from the image | ||
x0 = np.expand_dims(dino.flatten()[::-1], axis=0) | ||
x0 *= 2 | ||
n = 1 | ||
timesteps = 20 | ||
embed_dim = latent_dim | ||
system = SystemChecker(HeatEquation(latent_dim, embed_dim, noise_scale=0)) | ||
x = system.make_data(x0, timesteps=timesteps) | ||
plot(x[0], timesteps, system._system.dt, savefile="../graphics/hot_dino.gif") | ||
.. image:: ../_images/hot_dino.gif |
Oops, something went wrong.