Pruning Options

Pruning is simply done by a method which takes in three arguments. They are the full vector of weights to update, w, a collection of indexable kernel vectors, kvecs, and the set of indicies from the KernelDowndater, inds. The kernel vectors will each have the same length as inds, while w will have to be indexed by inds. The pruning method will then choose a single or a linear combination of the kernel vectors to prune with, and update the weights vector, w. The following method obtains the minimum perturbation along with the index zeroed out for a given weight vector and kernel vector.

CaratheodoryPruning.get_min_alpha_k0Function

get_min_alpha_k0(w, kvec, inds)

Helper method that, given a vector of weights, w, a kernel vector kvec, and a vector of indices, inds, returns a 2-tuple, (alpha,k0) used for pruning. alpha is the smallest magnitude multiple allowed such that w = w - alpha * kvec exactly zeros out at least index: k0.

source

CaratheodoryPruning.jl comes with several built-in pruning options. They can be easily used by calling caratheodory_pruning(V, w_in, pruning=PRUNING), replacing PRUNING with the appropriate method.

Prune first

Prunes using the first kernel vector in kvecs.

CaratheodoryPruning.prune_weights_first!Function

prune_weights_first!(w, kvecs, inds)

Takes in a vector of full-length weights, w, a vector of kernel vectors, kvecs, and a vector of indices, inds, to which the indices of the kernel vectors point in the weights.

Takes the first kernel vector, and prunes with that, using the minimum absolute value multiple needed to zero one of the weights.

source

Prune Minimum Absolute Value

Prunes according to the kernel vector in kvecs which results in the minimum absolute value multiple added.

CaratheodoryPruning.prune_weights_minabs!Function

prune_weights_minabs!(w, kvecs, inds)

Takes in a vector of full-length weights, w, a vector of kernel vectors, kvecs, and a vector of indices, inds, to which the indices of the kernel vectors point in the weights.

Loops over all kernel vectors, and prunes with the vector with the minimum absolute value multiple needed to zero one of the weights.

source