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
## With this PR | |
julia> using Dates | |
# PERIOD | |
julia> d = Day(1) | |
1 day | |
julia> show(d) |
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
julia> using Dates | |
# PERIOD | |
julia> d = Day(1) | |
1 day | |
julia> show(d) | |
Day(1) | |
julia> show([d]) |
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
' # Particle Swarm Optimizer | |
' ## Fitness function | |
rosenbrock:: Real -> Real -> Real | |
rosenbrock x y = sq (1.0 - x) + 100.0*sq (y - x*x) | |
' We write one that uses vector for input |
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
[[Base64]] | |
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" | |
[[BinaryProvider]] | |
deps = ["Libdl", "SHA"] | |
git-tree-sha1 = "5b08ed6036d9d3f0ee6369410b830f8873d4024c" | |
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" | |
version = "0.5.8" | |
[[Compat]] |
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
using Base.Threads | |
function threadcall(f::Function, run_on_thread::Int, args...; kwargs...) | |
@assert run_on_thread!=1 | |
rr = Future() | |
function inner() | |
function fun() | |
if Base.Threads.threadid()==1 | |
yield() |
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
a |
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
#== | |
A Simple scalar ForwardDiff using ChainRules + DualNumbers | |
--- | |
No promises are made to its correctness or safty. | |
Infact it probably errors for super standard cases. | |
But this is just to explain how it can work | |
==# | |
## Setup | |
using Pkg: Pkg, @pkg_str |
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.