@@ -21,13 +21,13 @@ julia> ] add AsynchronousIterativeAlgorithms
2121Say 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
102102sgd = SGD (0.01 )
0 commit comments