spsa-0.2.0.0: Simultaneous Perturbation Stochastic Approximation Optimization Algorithm

Math.Optimization.SPSA

Synopsis

# Documentation

defaultSPSA :: SPSASource

Make a default SPSA instance

Get the loss function out of StateSPSA

Get the constraint function out of StateSPSA

Get the stopping functions out of StateSPSA

Peel the next value from the two gain sequences and the perturbation vectors

Get the iteration count

Set the loss function

Set the constraint function

Push a stopping criteria onto SPSA

setGainA :: [Double] -> StateSPSA ()Source

Set the gainA sequence

setGainC :: [Double] -> StateSPSA ()Source

Set the gainC sequence

Set the perturbation sequence

Increment the iteration count

A stopping criteria is a function of current iteration number, last iteration theta, and current theta

Constructors

 Iterations Int NormDiff Double

Instances

 Eq StoppingCriteria

Check to see if we should stop based on the critieria, iteration count, last and current iteration

Loss Function

Constraint Function

Exported runSPSA function to extract the SPSA type

standardGainAk :: Double -> Int -> Double -> [Double]Source

Standard gain sequence for a_k = a / (k + 1 + A) ^ alpha | a is the most important and variable tuning parameter. Start with it set to get desired change in first iteration. | A is usually set to 10% of expected iterations | alpha is usually set to 0.602, but is valid up to 1.0 (the optimal for infinite iterations)

Standard gain sequence for c_k

Set semiautomatic tuning for the gain sequences | c should be about the standard deviation of a measurement | a is set how much you want the first iteration to move | A is set to be 10% of expected iterations | alpha and gamma are set to the lowest values for best finite iteration performance (not infinitely optimal)

bernoulli :: Int -> Int -> [Vector Double]Source

Create a bernoulli +1 / -1 distributed infinite series of perturbation vectors based on seed and dimension