Displaying 2 results from an estimated 2 matches for "gradientdesc".
2010 Oct 27
0
Introducing the futile.paradigm, a package for functional dispatching in R
...x <- iterate(old.x, algo)
if (converged(new.x, old.x)) break
old.x <- new.x
}
new.x
}
# Implement Newton-Raphson
iterate.nr %when% (algo %isa% NewtonRaphson)
iterate.nr <- function(x, algo) x - algo$f1(x) / algo$f2(x)
# Implement Gradient Descent
iterate.gd %when% (algo %isa% GradientDescent)
iterate.gd <- function(x, algo) x - algo$step * algo$f1(x)
# Create a custom type constructor
create.GradientDescent <- function(T, f1, step=0.01) list(f1=f1,step=step)
> algo <- create(GradientDescent, f1)
> minimize(3, algo)
[1] 3.677989e-06
# Execute using a dynamic type co...
2010 Oct 27
0
Introducing the futile.paradigm, a package for functional dispatching in R
...x <- iterate(old.x, algo)
if (converged(new.x, old.x)) break
old.x <- new.x
}
new.x
}
# Implement Newton-Raphson
iterate.nr %when% (algo %isa% NewtonRaphson)
iterate.nr <- function(x, algo) x - algo$f1(x) / algo$f2(x)
# Implement Gradient Descent
iterate.gd %when% (algo %isa% GradientDescent)
iterate.gd <- function(x, algo) x - algo$step * algo$f1(x)
# Create a custom type constructor
create.GradientDescent <- function(T, f1, step=0.01) list(f1=f1,step=step)
> algo <- create(GradientDescent, f1)
> minimize(3, algo)
[1] 3.677989e-06
# Execute using a dynamic type co...