This file contains hidden or 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
| ### A Pluto.jl notebook ### | |
| # v0.14.7 | |
| using Markdown | |
| using InteractiveUtils | |
| # ╔═╡ 4f4ffc64-cdf9-11eb-32ef-e5e79401898e | |
| using Random | |
| # ╔═╡ fdc3d3af-f680-41b0-903e-779be1b24206 |
This file contains hidden or 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
| ### A Pluto.jl notebook ### | |
| # v0.14.7 | |
| using Markdown | |
| using InteractiveUtils | |
| # ╔═╡ 8ce57352-cf5b-11eb-2624-976564fd9572 | |
| using Plots | |
| # ╔═╡ 22e5afa5-03a5-4c6c-9744-7417f1176839 |
This file contains hidden or 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
| ### A Pluto.jl notebook ### | |
| # v0.14.7 | |
| using Markdown | |
| using InteractiveUtils | |
| # ╔═╡ 8560c782-e7f0-11eb-1b79-21d0c85978db | |
| begin | |
| import CairoMakie as CM | |
| import LinearAlgebra |
This file contains hidden or 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
| # Author: Lewin Bormann, 2021 | |
| # A simple finite difference algorithm for differentiating a function numerically with respect to multiple dimensions. | |
| function mydiff(func, theta, releps=1e-3, reltol=1e-3) | |
| scale_eps = 1/2 | |
| grad = zeros(size(theta)) | |
| upper, lower = theta[:], theta[:] | |
| for (i, t) in enumerate(theta) | |
| count = 0 | |
| flipflop = 0 |
This file contains hidden or 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
| ### A Pluto.jl notebook ### | |
| # v0.15.1 | |
| using Markdown | |
| using InteractiveUtils | |
| # ╔═╡ cc62dbce-f820-11eb-168f-670217a987d9 | |
| begin | |
| import Pkg | |
| import Distributions |
This file contains hidden or 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
| ### A Pluto.jl notebook ### | |
| # v0.16.0 | |
| using Markdown | |
| using InteractiveUtils | |
| # ╔═╡ b70ce3a6-30e8-11ec-3f2a-59d54d66bfbd | |
| begin | |
| import Zygote | |
| import Plots |
This file contains hidden or 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
| import numpy as np | |
| #perf = [10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 2] | |
| perf = np.concatenate([4*np.ones(25), 2*np.ones(25), np.ones(25)]) | |
| #perf = list(range(40, 0, -1)) | |
| count = 0 | |
| def worseCommit(a, b): | |
| global count | |
| count += 1 |
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 hidden or 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
| import numpy as np | |
| class Expression: | |
| def __init__(self, left, right): | |
| self.l = left | |
| self.r = right | |
| self.eval_l = None | |
| self.eval_r = None | |
This file contains hidden or 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
| import numpy as np | |
| import tensorflow as tf | |
| def LV(N1, N2, eps1, eps2, gam1, gam2): | |
| dt = tf.constant(1.) | |
| states = [(N1, N2)] | |
| for i in range(1, 13): | |
| states.append((states[i-1][0] + (states[i-1][0] * (eps1-gam1*states[i-1][1])) * dt, states[i-1][1] - states[i-1][1] * (eps2-gam2*states[i-1][0])) * dt) | |
| return states[-1] |