Skip to content

Commit cdbb3fd

Browse files
committed
custom execution
1 parent 6e31ac4 commit cdbb3fd

File tree

9 files changed

+409
-257
lines changed

9 files changed

+409
-257
lines changed

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
88
DistributedObjects = "00fc1a24-2ccf-42b7-af30-c6381044c15f"
99
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1010
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
11+
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
1112

1213
[compat]
13-
julia = "1"
14-
ProgressMeter = "1.7.2"
1514
DistributedObjects = "0.1.5"
15+
ProgressMeter = "1.7.2"
16+
julia = "1"
1617

1718
[extras]
1819
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Now to the implementation.
5656
mutable struct SGD<:AbstractAlgorithm{Vector{Float64},Vector{Float64}}
5757
stepsize::Float64
5858
previous_q::Vector{Float64} # previous query
59-
SGD(stepsize::Float64) = new(stepsize, Vector{Float64}())
59+
SGD(stepsize::Float64) = new(stepsize, Float64[])
6060
end
6161

6262
# initialisation step

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Documenter
22
using AsynchronousIterativeAlgorithms
3+
const AIA = AsynchronousIterativeAlgorithms
34

45
makedocs(
56
sitename = "AsynchronousIterativeAlgorithms.jl",

docs/src/documentation.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
# Documentation
22

3-
## `start` and `start!`
3+
## `start`
44

55
```@docs
66
start
77
```
88

9-
```@docs
10-
start!
11-
```
12-
139
## `AbstractAlgorithm`
1410

1511
The algorithm you pass to [`start`](@ref) should subtype `AbstractAlgorithm{Q,A}`.
@@ -18,7 +14,33 @@ The algorithm you pass to [`start`](@ref) should subtype `AbstractAlgorithm{Q,A}
1814
AbstractAlgorithm
1915
```
2016

21-
## Algorithm templates
17+
## Customization of `start`'s execution
18+
19+
```@docs
20+
stopnow
21+
```
22+
23+
```@docs
24+
savenow
25+
```
26+
27+
```@docs
28+
savevalues
29+
```
30+
31+
```@docs
32+
report
33+
```
34+
35+
```@docs
36+
progress
37+
```
38+
39+
```@docs
40+
showvalues
41+
```
42+
43+
## Algorithm wrappers
2244

2345
The two following algorithms already subtype [`AbstractAlgorithm{Q,A}`](@ref) and are ready to use in [`start`](@ref).
2446

@@ -28,5 +50,4 @@ AggregationAlgorithm
2850

2951
```@docs
3052
AveragingAlgorithm
31-
3253
```

docs/src/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ julia> ] add AsynchronousIterativeAlgorithms
2121
Say you want to implement a distributed version of *Stochastic Gradient Descent* (SGD). You'll need to define:
2222

2323
- an **algorithm structure** subtyping [`AbstractAlgorithm{Q,A}`](@ref)
24-
- the **initialisation step** where you compute the first iteration
24+
- the **initialization step** where you compute the first iteration
2525
- the **worker step** performed by the workers when they receive a query `q::Q` from the central node
2626
- the asynchronous **central step** performed by the central node when it receives an answer `a::A` from a `worker`
2727

2828
![Sequence Diagram](assets/sequence_diagram.png)
2929

30-
Let's first of all set up our distributed environement.
30+
Let's first of all set up our distributed environment.
3131

3232
```julia
3333
# Launch multiple processes (or remote machines)
@@ -49,7 +49,7 @@ Now to the implementation.
4949
mutable struct SGD<:AbstractAlgorithm{Vector{Float64},Vector{Float64}}
5050
stepsize::Float64
5151
previous_q::Vector{Float64} # previous query
52-
SGD(stepsize::Float64) = new(stepsize, Vector{Float64}())
52+
SGD(stepsize::Float64) = new(stepsize, Float64[])
5353
end
5454

5555
# initialisation step
@@ -96,7 +96,7 @@ We're almost ready to start the algorithm...
9696

9797
```julia
9898
# Provide the stopping criteria
99-
stopat = (1000,0,0.) # (iterations, epochs, time)
99+
stopat = (iteration=1000, time=42.)
100100

101101
# Instanciate your algorithm
102102
sgd = SGD(0.01)

0 commit comments

Comments
 (0)