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
# Multiple dispatch | |
#https://www.juliabox.com/notebook/notebooks/tutorials/intro-to-julia/10.%20Multiple%20dispatch.ipynb | |
using InteractiveUtils | |
versioninfo() | |
#= | |
In this script we'll explore multiple dispatch, which is as key | |
feature of Julia. |
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
# https://www.juliabox.com/notebook/notebooks/tutorials/intro-to-julia/AutoDiff.ipynb | |
# Auto Diff | |
using InteractiveUtils | |
versioninfo() | |
# The example is the Babylonian algorithm, known to man for millenia, to compute sqrt(x) | |
function Babylonian(x; N = 10) | |
t = (1+x)/2 | |
for i = 2:N # For illustration purposes, 10 iterations suffice. |
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
# https://www.juliabox.com/notebook/notebooks/tutorials/intro-to-julia/AutoDiff.ipynb | |
# Dual Number | |
using InteractiveUtils | |
versioninfo() | |
struct D <: Number | |
f::Tuple{Float64,Float64} | |
end |
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
# auto diff from scratch | |
""" | |
Reference: | |
https://www.juliabox.com/notebook/notebooks/tutorials/intro-to-julia/AutoDiff.ipynb | |
http://hplgit.github.io/primer.html/doc/pub/class/._class-readable005.html | |
https://docs.python.jp/3/reference/datamodel.html#object.__radd__ | |
https://docs.python.org/3/whatsnew/3.5.html#pep-485-a-function-for-testing-approximate-equality | |
https://docs.python.jp/3/library/operator.html#module-operator | |
https://www.physicsforums.com/threads/derivative-of-f-x-to-the-power-of-g-x-and-algebra-problem.273333/ |
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
#= | |
Linear Regression using Flux.jl | |
pkg> add Flux#master | |
pkg> add Plots | |
Reference: | |
https://qiita.com/cometscome_phys/items/f58174c0dad7ecb811ed | |
=# |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.