Class IVM¶
Defined in File IVM.h
Inheritance Relationships¶
Base Type¶
public SubmodularFunction(Class SubmodularFunction)
Derived Type¶
public FastIVM(Class FastIVM)
Class Documentation¶
-
class IVM : public SubmodularFunction¶
This class implements the InformativeVectorMachine:
\[ f(S) = \frac{1}{2}\log\det\left(\Sigma + \sigma \cdot \mathcal I \right) \]where \(\Sigma\) is the kernel matrix of all elements in the summary, \( \mathcal I \) is the \( K \times K \) identity matrix and \( \sigma > 0 \) is a scaling parameter. This implementation is lazy and slow. It recomputes \( \Sigma \) in every evaluation. For a faster and more practical alternative please have a look at the FastIVM class. This class internally uses the Matrix class for somewhat readable linear algebra.References
Herbrich, R., Lawrence, N., & Seeger, M. (2003). Fast Sparse Gaussian Process Methods: The Informative Vector Machine. In S. Becker, S. Thrun, & K. Obermayer (Eds.), Advances in Neural Information Processing Systems (Vol. 15, pp. 625–632). MIT Press. Retrieved from https://proceedings.neurips.cc/paper/2002/file/d4dd111a4fd973394238aca5c05bebe3-Paper.pdf
Subclassed by FastIVM
Public Functions
-
inline IVM(Kernel const &kernel, data_t sigma)¶
Creates a new IVM object with the given parameters.
Note
This constructor uses assert to make sure that sigma has the correct range. This may lead to warnings during compilation.
- Parameters
&kernel – The kernel to be used.
sigma – The scaling constant
- Returns A
new IVM object
-
inline IVM(std::function<data_t(std::vector<data_t> const&, std::vector<data_t> const&)> kernel, data_t sigma)¶
Creates a new IVM object with the given parameters.
Note
This constructor uses assert to make sure that sigma has the correct range. This may lead to warnings during compilation.
- Parameters
kernel – The kernel to be used.
sigma – The scaling constant
- Returns A
new IVM object
-
inline virtual data_t peek(std::vector<std::vector<data_t>> const &cur_solution, std::vector<data_t> const &x, unsigned int pos) override¶
Peek operator for the IVM. For more details see SubmodularFunction. This implementation simply adds / replaces the current item in the summary and recomputes the kernel matrix as well as the log-determinant. The runtime of this implementation is O(K^3) with K = cur_solution.size()
Note
The log-determinant is computed via a cholesky decomposition.
- Parameters
cur_solution – The current summary
&x – The element which should be added to the summary
pos – The position at which the given element should be inserted. If pos >= cur_solution.size(), then x is appended. Otherwise it replaces the element at position pos
- Returns The
log-determinant of the kernel matrix, if x would be inserted at position pos in current_solution
-
inline virtual void update(std::vector<std::vector<data_t>> const &cur_solution, std::vector<data_t> const &x, unsigned int pos) override¶
Does nothing and only exists for compatibility reasons.
- Parameters
&cur_solution –
&x –
pos –
- Returns None
-
inline virtual data_t operator()(std::vector<std::vector<data_t>> const &X) const override¶
Computes the kernel matrix \Sigma + \sigma \cdot \mathcal I between all pairs in X and its log-determinant. The runtime is O(K^3) where K = X.size().
Note
The log-determinant is computed via a cholesky decomposition.
- Parameters
&X – The argument at which \(f(X) = \frac{1}{2}\log\det\left(\Sigma + \sigma \cdot \mathcal I \right)\) should be evaluated
- Returns The
log-determinant of the kernel matrix of all pairs in X
-
inline virtual std::shared_ptr<SubmodularFunction> clone() const override¶
Clones the current IVM object.
Note
Calls the clone method of the given kernel. If the kernel implements a deep-copy, then this clone operation is also a deep -opy. Otherwise it is not.
- Returns The
cloned object.
-
inline ~IVM()¶
Destroys the current object.
Note
- Returns
Protected Functions