15. Nobel prize in economic sciences
The founder of QuantEcon
“His team at NYU uses Julia for macroeconomic modeling and contributes
to the Julia ecosystem.”
https://juliacomputing.com/case-studies/thomas-sargent.html
15
16. In 2015, economists at the Federal Reserve Bank of New York (FRBNY)
published FRBNY’s most comprehensive and complex macroeconomic
models, known as Dynamic Stochastic General Equilibrium, or DSGE
models, in Julia.
https://juliacomputing.com/case-studies/ny-fed.html
16
17. UK cancer researchers turned to Julia to run simulations of tumor growth.
Nature Genetics, 2016
Approximate Bayesian Computation (ABC) algorithms require potentially millions of
simulations - must be fast
BioJulia project for analyzing biological data in Julia
Bayesian MCMC methods Lora.jl and Mamba.jl
https://juliacomputing.com/case-studies/nature.html
17
18. IBM and Julia Computing analyzed eye fundus images provided by Drishti
Eye Hospitals.
Timely screening for changes in the retina can help get them to treatment
and prevent vision loss. Julia Computing’s work using deep learning
makes retinal screening an activity that can be performed by a trained
technician using a low cost fundus camera.
https://juliacomputing.com/case-studies/ibm.html
18
19. Path BioAnalytics is a computational biotech company developing novel
precision medicine assays to support drug discovery and development,
and treatment of disease.
https://juliacomputing.com/case-studies/pathbio.html
19
20. The Sloan Digital Sky Survey contains nearly 5 million telescopic images
of 12 megabytes each – a dataset of 55 terabytes.
In order to analyze this massive dataset, researchers at UC Berkeley and
Lawrence Berkeley National Laboratory created a new code named
Celeste.
https://juliacomputing.com/case-studies/intel-astro.html
20
41. 動態型別
Value is immutable
x = 5
println(x) # 5
println(typeof(x)) # Int64
x = 6.0
println(x) # 6.0
println(typeof(x)) # Float64
41
42. 算術運算子
+x: 就是x本身
-x: 變號
x + y, x - y, x * y, x / y: 一般四則運算
div(x, y): 商
x % y: 餘數,也可以用rem(x, y)
x y: 反除,等價於y / x
x ^ y: 次方
42
43. 位元運算子
~x: bitwise not
x & y: bitwise and
x | y: bitwise or
x ⊻ y: bitwise xor
x >>> y:無正負號,將x的位元右移y個位數
x >> y:保留正負號,將x的位元右移y個位數
x << y: 將x的位元左移y個位數
https://www.technologyuk.net/mathematics/number-systems/images/binary_number.gif
43
62. Easy to optimize
Allow generalization and flexibility, and enable to optimize.
Hints:
Avoid global variables
Add type declarations
Measure performance with @time and pay attention to memory
allocation
……
62
69. Type system
Use type, not class
Define methods out of type
Multiple dispatch on types
Type hierarchy
Traits for method interface
69
70. Use type, not class
Type!
struct Dog
name::String
color::String
end
dog = Dog(“Tom”, “brown”)
Name: Tom
Color: brown
71. Define methods out of type
function color(a::Animal)
return a.color
end
function voice(d::Dog)
return "bark"
end
function voice(c::Cat)
return "meow"
end
72. Multiple dispatch on types
function double(obj::Foo, x)
return 2*x
end
function double(obj::Bar, x)
return string(x)*2
end
double
double
args
(obj::Foo, x::Any)
(obj::Bar, x::Any)
74. Traits for method interface
Traits define a set of functions
Implement a trait with types
Independent of type hierarchy
74
https://github.com/mauro3/SimpleTraits.jl
101. Flux.jl
100% 純 Julia
支援自動微分
支援高階抽象以及低階 API
套件直接相容語言
支援CUDA,但不依賴 CUDA C 函式
庫
101
102. Flux.jl
100% 純 Julia
直接是 Julia 的效能
支援自動微分
支援各式函數微分
支援CUDA,但不依賴 CUDA C 函式
庫
由 Julia 提供與 CUDA C 函式庫匹敵的效能
102
103. Flux.jl - 支援高階抽象以及低階 API
103
Pic: https://blog.algorithmia.com/introduction-to-loss-functions/
Loss function
Pic: http://dsdeepdive.blogspot.com/2016/03/optimizations-of-gradient-descent.html
Gradient
107. Turing.jl
Universal probabilistic programming with an intuitive
modelling interface
Hamiltonian Monte Carlo (HMC) sampling
Gibbs sampling that combines particle MCMC, HMC and
many other MCMC algorithms
107
108. Learn.jl
General abstractions and algorithms for modeling and
optimization
Implementations of common models
Tools for working with datasets
108
109. Others
TensorFlow.jl
MXNet.jl
Mocha.jl
Klara.jl: MCMC inference in Julia
Mamba.jl: Markov chain Monte Carlo (MCMC) for Bayesian
analysis in julia
109
125. HPC from Intel Labs
Video
https://www.youtube.com/watch?v=Qa7nfaDacII
Slide
https://www.slideshare.net/EhsanTotoni/hpat-presentation-at-juliacon-2016
Github
2015: IntelLabs/ParallelAccelerator.jl
2016: IntelLabs/HPAT.jl
High Performance Analytics Toolkit (HPAT) is a Julia-based framework for big data
analytics on clusters.
2018: IntelLabs/Latte.jl
A high-performance DSL for deep neural networks in Julia
125
the next generation of macroeconomic models is very computationally intensive with large datasets and large numbers of variables
First, as free software
Second, as the models that we use for forecasting and policy analysis grow more complicated, we need a language that can perform computations at a high speed