Random Descent
NonArchimedeanMachineLearning.RandomDescentConfig — Type
RandomDescentConfig(; strict=false, degree=1, start_branch=1)Configuration for random descent (baseline optimizer).
Fields
strict::Bool: If true, descend one coordinate at a time; if false, descend all coordinatesdegree::Int: Number of children to explore per polydisc node (non-strict mode)start_branch::Int: Coordinate to descend along first (strict mode)
NonArchimedeanMachineLearning.random_descent — Method
random_descent(loss::Loss, param::ValuationPolydisc{S,T,N}, next_branch::Int, settings::RandomDescentConfig) where {S,T,N}Perform one step of random descent (baseline optimizer).
BASELINE ONLY: Randomly selects a child without evaluating loss. Used to demonstrate that structured optimization algorithms outperform random exploration.
Arguments
loss::Loss: The loss function structure (not used in selection)param::ValuationPolydisc{S,T,N}: Current parameter valuesnext_branch::Int: Index of the next branch to descend in strict modesettings::RandomDescentConfig: Configuration for random descent
Returns
Tuple{ValuationPolydisc{S,T,N}, Int, Bool}: Randomly selected child, next branch index, and convergence status
NonArchimedeanMachineLearning.random_descent_init — Method
random_descent_init(param::ValuationPolydisc{S,T,N}, loss::Loss, settings::RandomDescentConfig=RandomDescentConfig()) where {S,T,N}Initialize an optimization setup for random descent.
BASELINE ONLY: This optimizer is used for baseline comparison to demonstrate the effectiveness of structured optimization algorithms.
Arguments
param::ValuationPolydisc{S,T,N}: Initial parameter valuesloss::Loss: The loss function structuresettings::RandomDescentConfig: Configuration controlling descent behavior
Returns
OptimSetup: Configured optimization setup for random descent
Example
# Create baseline optimizer for comparison
random_optim = random_descent_init(param, loss, RandomDescentConfig())
greedy_optim = greedy_descent_init(param, loss, GreedyDescentConfig())
# Compare performance
for i in 1:20
step!(random_optim)
step!(greedy_optim)
end
println("Random: ", eval_loss(random_optim))
println("Greedy: ", eval_loss(greedy_optim)) # Should be much better