dlib C++ Library - Algorithms

The Library

- Algorithms
- API Wrappers
- Compression
- Containers
- Imaging
- Metaprogramming
- Miscellaneous
- Network
- Parsing

Help/Info

- Examples
  - Base64_Encoder
  - Bayesian_Network
  - Bayesian_Network_From_Disk
  - Bayesian_Network_GUI
  - Cmd_Line_Parser
  - Compress_Stream
  - Directory_Navigation
  - GUI
  - HTTP_Server
  - Image
  - Kernel_Centroid
  - Kernel_K-Means_Clustering
  - Kernel_RLS_Filtering
  - Kernel_RLS_Regression
  - Logger
  - Logger_Advanced
  - Matrix
  - Member_Function_Pointer
  - Multithreaded_Object
  - Neural_Network
  - Pipe
  - Queue
  - Rank_Features
  - Relevance_Vector_Classification
  - Relevance_Vector_Regression
  - Sockets
  - Sockets_2
  - Sockstreambuf
  - Std_C++_Allocator
  - Support_Vector_Machine
  - Threaded_Object
  - Threads
  - Thread_Function
  - Thread_Pool
  - Timer
  - XML_Parser
- Home
- How to compile
- Index
- Introduction
- License

Current Release

- Change Log
- Release Notes
- Version: 17.12

Last Modified: Nov 10, 2008

# Algorithms

This page documents library components that are all basically just implementations of mathematical functions or algorithms without any really significant data structures associated with them. So this includes things like checksums, cryptographic hashes, machine learning algorithms, sorting, etc...

Tools

- Bayes Utilities
  - assignment
  - Bayes Node Utilities
    - node_cpt_filled_out
    - node_first_parent_assignment
    - node_is_evidence
    - node_next_parent_assignment
    - node_num_values
    - node_probability
    - node_value
    - set_node_as_evidence
    - set_node_as_nonevidence
    - set_node_num_values
    - set_node_probability
    - set_node_value
  - bayesian_network_gibbs_sampler
  - bayesian_network_join_tree
  - bayes_node
  - conditional_probability_table
  - joint_probability_table
- bigint
- crc32
- Geometry
  - centered_rect
  - move_rect
  - nearest_point
  - point
  - rectangle
  - resize_rect
  - resize_rect_height
  - resize_rect_width
  - translate_rect
  - vector
- Graph Utilities
  - copy_graph_structure
  - create_join_tree
  - create_moral_graph
  - edge
  - find_connected_nodes
  - graph_contains_directed_cycle
  - graph_contains_length_one_cycle
  - graph_contains_undirected_cycle
  - graph_is_connected
  - is_clique
  - is_join_tree
  - is_maximal_clique
  - triangulate_graph_and_find_cliques
- hsort_array
- isort_array
- is_binary_classification_problem
- Kernel_Methods
  - cross_validate_trainer
  - cross_validate_trainer_threaded
  - Function_Objects
    - decision_function
    - distance_function
    - normalized_function
    - probabilistic_decision_function
  - kcentroid
  - Kernels
    - linear_kernel
    - polynomial_kernel
    - radial_basis_kernel
    - sigmoid_kernel
  - kkmeans
  - krls
  - linearly_independent_subset_finder
  - pick_initial_centers
  - rank_features
  - rbf_network_trainer
  - reduced
  - reduced2
  - reduced_decision_function_trainer
  - reduced_decision_function_trainer2
  - rvm_regression_trainer
  - rvm_trainer
  - svm_nu_trainer
  - test_binary_decision_function
  - train_probabilistic_decision_function
- md5
- median
- mlp
- Optimization
  - derivative
  - find_min_conjugate_gradient
  - find_min_conjugate_gradient2
  - find_min_quasi_newton
  - find_min_quasi_newton2
  - line_search
  - make_line_search_function
  - poly_min_extrap
- put_in_range
- qsort_array
- rand
- randomize_samples
- running_stats
- Set Utilities
  - set_difference
  - set_intersection
  - set_intersection_size
  - set_union
- square_root
- vector_normalizer

[top]

# assignment

This object models an assignment of random variables to particular values. It is used with the joint_probability_table and conditional_probability_table objects to represent assignments of various random variables to actual values.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1, 2
[top]

# bayesian_network_gibbs_sampler

This object performs Markov Chain Monte Carlo sampling of a bayesian network using the Gibbs sampling technique.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1
[top]

# bayesian_network_join_tree

This object represents an implementation of the join tree algorithm (a.k.a. the junction tree algorithm) for inference in bayesian networks.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1, 2, 3
[top]

# bayes_node

This object represents a node in a bayesian network. It is intended to be used inside the directed_graph object to represent bayesian networks.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1, 2
[top]

# bigint

This object represents an arbitrary precision unsigned integer. It's pretty simple. It's interface is just like a normal int, you don't have to tell it how much memory to use or anything unusual. It just goes :)
Specification: dlib/bigint/bigint_kernel_abstract.h
File to include: dlib/bigint.h
Implementations:

> bigint_kernel_1:
> This implementation is done using an array of unsigned shorts. It is also reference counted. For further details see the above link. Also note that kernel_2 should be faster in almost every case so you should really just use that version of the bigint object.

> kernel_1a | is a typedef for bigint_kernel_1
> kernel_1a_c | is a typedef for kernel_1a that checks its preconditions.

> bigint_kernel_2:
> This implementation is basically the same as kernel_1 except it uses the Fast Fourier Transform to perform multiplcations much faster.

> kernel_2a | is a typedef for bigint_kernel_2
> kernel_2a_c | is a typedef for kernel_2a that checks its preconditions.

[top]

# centered_rect

There are various overloads of this function but the basic idea is that it returns a rectangle with a given width and height and centered about a given point.
Specification: dlib/geometry/rectangle_abstract.h
File to include: dlib/geometry.h
[top]

# conditional_probability_table

This object represents a conditional probability table.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
[top]

# copy_graph_structure

This function takes a graph or directed_graph and copies its structure to another graph or directed_graph object. The only restriction is that you can't copy the structure of a graph into a directed_graph. The three other possible combinations are allowed however.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# crc32

This object represents the CRC-32 algorithm for calculating checksums.
Specification: dlib/crc32/crc32_kernel_abstract.h
File to include: dlib/crc32.h
Implementations:

> crc32_kernel_1:
> This implementation uses the polynomial 0xedb88320.

> kernel_1a | is a typedef for crc32_kernel_1

[top]

# create_join_tree

This function takes a graph object and creates a join tree for that graph. Or in other words, this function finds a tree decomposition of the given graph.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# create_moral_graph

This function takes a directed_graph and returns the moralized version of the graph in the form of a graph object.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# cross_validate_trainer

Performs k-fold cross validation on a user supplied trainer object such as the svm_nu_trainer or rbf_network_trainer.
Specification: dlib/svm/svm_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# cross_validate_trainer_threaded

Performs k-fold cross validation on a user supplied trainer object such as the svm_nu_trainer or rbf_network_trainer. This function does the same thing as cross_validate_trainer except this function also allows you to specify how many threads of execution to use. So you can use this function to take advantage of a multi-core system to perform cross validation faster.
Specification: dlib/svm/svm_threaded_abstract.h
File to include: dlib/svm_threaded.h
[top]

# decision_function

This object represents a decision or regression function that was learned by a kernel based learning algorithm.
Specification: dlib/svm/function_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# derivative

This is a function that takes another function as input and returns a function object that numerically computes the derivative of the input function.
Specification: dlib/optimization/optimization_abstract.h
File to include: dlib/optimization.h
[top]

# distance_function

This object represents a point in kernel induced feature space. You may use this object to find the distance from the point it represents to points in input space.
Specification: dlib/svm/function_abstract.h
File to include: dlib/svm.h
[top]

# edge

This function takes a graph object and a pair of indices. It returns a reference to the edge object between the two nodes with the given indices.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# find_connected_nodes

This function takes a node from a graph or directed_graph object and a set of unsigned longs. It finds all the nodes in the given graph that are connected to the given node by an undirected path and returns them in the set (also note that the original query node is also returned in this set).
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# find_min_conjugate_gradient

Performs an unconstrained minimization of the potentially nonlinear function f() using a conjugate gradient method.
Specification: dlib/optimization/optimization_abstract.h
File to include: dlib/optimization.h
[top]

# find_min_conjugate_gradient2

Performs an unconstrained minimization of the potentially nonlinear function f() using a conjugate gradient method. This version doesn't take a gradient function of f() but instead numerically approximates the gradient.
Specification: dlib/optimization/optimization_abstract.h
File to include: dlib/optimization.h
[top]

# find_min_quasi_newton

Performs an unconstrained minimization of the potentially nonlinear function f() using the BFGS quasi newton method.
Specification: dlib/optimization/optimization_abstract.h
File to include: dlib/optimization.h
[top]

# find_min_quasi_newton2

Performs an unconstrained minimization of the potentially nonlinear function f() using the BFGS quasi newton method. This version doesn't take a gradient function of f() but instead numerically approximates the gradient.
Specification: dlib/optimization/optimization_abstract.h
File to include: dlib/optimization.h
[top]

# graph_contains_directed_cycle

This function checks a directed_graph for directed cycles.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# graph_contains_length_one_cycle

This function takes a graph or directed_graph object and returns true if and only if the graph contains a node that has an edge that links back to itself.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# graph_contains_undirected_cycle

This function checks a directed_graph for undirected cycles.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# graph_is_connected

This function takes a graph or directed_graph object and determines if the graph is connected. That is, it returns true if and only if there is an undirected path between any two nodes in the given graph.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# hsort_array

hsort_array is an implementation of the heapsort algorithm. It will sort anything that has an array like operator[] interface.
Specification: dlib/sort.h
File to include: dlib/sort.h
[top]

# isort_array

isort_array is an implementation of the insertion sort algorithm. It will sort anything that has an array like operator[] interface.
Specification: dlib/sort.h
File to include: dlib/sort.h
[top]

# is_binary_classification_problem

This function simply takes two vectors, the first containing feature vectors and the second containing labels, and reports back if the two could possibly contain data for a well formed classification problem.
Specification: dlib/svm/svm_abstract.h
File to include: dlib/svm.h
[top]

# is_clique

This function takes a graph and a set of node index values and checks if the specified set of nodes is a clique in the graph.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# is_join_tree

This function takes two graph objects and checks if the second of the two graphs is a valid join tree (aka tree decomposition) of the first graph.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# is_maximal_clique

This function takes a graph and a set of node index values and checks if the specified set of nodes is a maximal clique in the graph.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# joint_probability_table

This object represents a joint probability table.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
[top]

# kcentroid

This is an implementation of an online algorithm for recursively estimating the centroid of a sequence of training points. It uses the sparsification technique described in the paper The Kernel Recursive Least Squares Algorithm by Yaakov Engel.

This object then allows you to compute the distance between the center of mass and any test points. So you can use this object to predict how similar a test point is to the data this object has been trained on (larger distances from the centroid indicate dissimilarity/anomalous points).

Specification: dlib/svm/kcentroid_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# kkmeans

This is an implementation of a kernelized k-means clustering algorithm. It performs k-means clustering by using the kcentroid object.
Specification: dlib/svm/kkmeans_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# krls

This is an implementation of the kernel recursive least squares algorithm described in the paper The Kernel Recursive Least Squares Algorithm by Yaakov Engel.

The long and short of this algorithm is that it is an online kernel based regression algorithm. You give it samples (x,y) and it learns the function f(x) == y. For a detailed description of the algorithm read the above paper.

Specification: dlib/svm/krls_abstract.h
File to include: dlib/svm.h
Code Examples: 1, 2
[top]

# linearly_independent_subset_finder

This is an implementation of an online algorithm for recursively finding a set of linearly independent vectors in a kernel induced feature space. To use it you decide how large you would like the set to be and then you feed it sample points.

Each time you present it with a new sample point it either keeps the current set of independent points unchanged, or if the new point is "more linearly independent" than one of the points it already has, it replaces the weakly linearly independent point with the new one.

This object uses the Approximately Linearly Dependent metric described in the paper The Kernel Recursive Least Squares Algorithm by Yaakov Engel to decide which points are more linearly independent than others.

Specification: dlib/svm/linearly_independent_subset_finder_abstract.h
File to include: dlib/svm.h
[top]

# linear_kernel

This object represents a linear function kernel for use with kernel learning machines.
Specification: dlib/svm/kernel_abstract.h
File to include: dlib/svm.h
[top]

# line_search

Performs a line search on a given function and returns the input that makes the function significantly smaller.
Specification: dlib/optimization/optimization_abstract.h
File to include: dlib/optimization.h
[top]

# make_line_search_function

This is a function that takes another function f(x) as input and returns a function object l(z) = f(start + z*direction).
Specification: dlib/optimization/optimization_abstract.h
File to include: dlib/optimization.h
[top]

# md5

This is an implementation of The MD5 Message-Digest Algorithm as described in rfc1321.
Specification: dlib/md5/md5_kernel_abstract.h
File to include: dlib/md5.h
[top]

# median

This function takes three paramaters and finds the median of the three. The median is swapped into the first parameter and the first parameter ends up in one of the other two, unless the first parameter was the median to begin with of course.
Specification: dlib/algs.h
File to include: dlib/algs.h
[top]

# mlp

This object represents a multilayer layer perceptron network that is trained using the back propagation algorithm. The training algorithm also incorporates the momentum method. That is, each round of back propagation training also adds a fraction of the previous update. This fraction is controlled by the momentum term set in the constructor.
Specification: dlib/mlp/mlp_kernel_abstract.h
File to include: dlib/mlp.h
Code Examples: 1
Implementations:

> mlp_kernel_1:
> This is implemented in the obvious way.

> kernel_1a | is a typedef for mlp_kernel_1
> kernel_1a_c | is a typedef for kernel_1a that checks its preconditions.

[top]

# move_rect

This function takes a rectangle and moves it so that it's upper left corner occupies the given location.
Specification: dlib/geometry/rectangle_abstract.h
File to include: dlib/geometry.h
[top]

# nearest_point

This function takes a rectangle and a point and returns the point in the given rectangle that is nearst to the given point.
Specification: dlib/geometry/rectangle_abstract.h
File to include: dlib/geometry.h
[top]

# node_cpt_filled_out

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily verify that a node in a bayesian network has its conditional_probability_table completely filled out.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1
[top]

# node_first_parent_assignment

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily obtain an assignment that contains all the parents of a node in a bayesian network.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1
[top]

# node_is_evidence

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily determine if a bayes_node is evidence when it is inside a directed_graph object.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
[top]

# node_next_parent_assignment

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily loop through all the parent assignments of a node in a bayesian network.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1
[top]

# node_num_values

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily obtain the number of values of a bayes_node when it is inside a directed_graph object.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
[top]

# node_probability

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily obtain the probability of a bayes_node given its parents when it is inside a directed_graph object.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
[top]

# node_value

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily obtain the value of a bayes_node when it is inside a directed_graph object.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
[top]

# normalized_function

This object represents a container for another function object and an instance of the vector_normalizer object. It automatically noramlizes all inputs before passing them off to the contained function object.
Specification: dlib/svm/function_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# pick_initial_centers

This is a function that you can use to seed data clustering algorithms like the kkmeans clustering method. What it does is pick reasonable starting points for clustering by basically trying to find a set of points that are all far away from each other.
Specification: dlib/svm/kkmeans_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# point

This object represents a point inside a Cartesian coordinate system.
Specification: dlib/geometry/vector_abstract.h
File to include: dlib/geometry.h
[top]

# polynomial_kernel

This object represents a polynomial kernel for use with kernel learning machines.
Specification: dlib/svm/kernel_abstract.h
File to include: dlib/svm.h
[top]

# poly_min_extrap

This function finds the 3rd degree polynomial that interpolates a set of points and returns you the minimum of that polynomial.
Specification: dlib/optimization/optimization_abstract.h
File to include: dlib/optimization.h
[top]

# probabilistic_decision_function

This object represents a binary decision function for use with support vector machines. It returns an estimate of the probability that a given sample is in the +1 class.
Specification: dlib/svm/function_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# put_in_range

This is a simple function that takes a range and a value and returns the given value if it is within the range. If it isn't in the range then it returns the end of range value that is closest.
Specification: dlib/algs.h
File to include: dlib/algs.h
[top]

# qsort_array

qsort_array is an implementation of the QuickSort algorithm. It will sort anything that has an array like operator[] interface. If the quick sort becomes unstable then it switches to a heap sort. This way sorting is guaranteed to take at most N*log(N) time.
Specification: dlib/sort.h
File to include: dlib/sort.h
[top]

# radial_basis_kernel

This object represents a radial basis function kernel for use with kernel learning machines.
Specification: dlib/svm/kernel_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# rand

This object represents a pseudorandom number generator.
Specification: dlib/rand/rand_kernel_abstract.h
File to include: dlib/rand.h
Implementations:

> rand_kernel_1:
> This implementation is done using the Mersenne Twister algorithm.

> kernel_1a | is a typedef for rand_kernel_1

## Extensions to rand

rand_float:
This extension gives rand the ability to generate random floating point numbers.
Specification: dlib/rand/rand_float_abstract.h
Implementations:

> rand_float_1:
> The implementation is obvious. Click on the link if you want to see.

> float_1a | is a typedef for rand_kernel_1a extended by rand_float_1

[top]

# randomize_samples

Randomizes the order of samples in a column vector containing sample data.
Specification: dlib/svm/svm_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# rank_features

Finds a ranking of the top N (a user supplied parameter) features in a set of data from a two class classification problem. It does this by computing the distance between the centroids of both classes in kernel defined feature space. Good features are then ones that result in the biggest separation between the two centroids.
Specification: dlib/svm/feature_ranking_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# rbf_network_trainer

Trains a radial basis function network and outputs a decision_function.
Specification: dlib/svm/rbf_network_abstract.h
File to include: dlib/svm.h
[top]

# rectangle

This object represents a rectangular region inside a cartesian coordinate system. It allows you to easily represent and manipulate rectangles.
Specification: dlib/geometry/rectangle_abstract.h
File to include: dlib/geometry.h
[top]

# reduced

This is a convenience function for creating reduced_decision_function_trainer objects.
Specification: dlib/svm/reduced_abstract.h
File to include: dlib/svm.h
[top]

# reduced2

This is a convenience function for creating reduced_decision_function_trainer2 objects.
Specification: dlib/svm/reduced_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# reduced_decision_function_trainer

This is a trainer object that is meant to wrap other trainer objects that create decision_function objects. It performs post processing on the output decision_function objects with the intent of representing the decision_function with fewer support vectors.
Specification: dlib/svm/reduced_abstract.h
File to include: dlib/svm.h
[top]

# reduced_decision_function_trainer2

This is a trainer object that is meant to wrap other trainer objects that create decision_function objects. It performs post processing on the output decision_function objects with the intent of representing the decision_function with fewer support vectors.

It begins by performing the same post processing as the reduced_decision_function_trainer object but it also performs a global gradient based optimization to further improve the results.

Specification: dlib/svm/reduced_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# resize_rect

This function takes a rectangle and returns a new rectangle with the given size but with the same upper left corner as the original rectangle.
Specification: dlib/geometry/rectangle_abstract.h
File to include: dlib/geometry.h
[top]

# resize_rect_height

This function takes a rectangle and returns a new rectangle with the given height but otherwise with the same edge points as the original rectangle.
Specification: dlib/geometry/rectangle_abstract.h
File to include: dlib/geometry.h
[top]

# resize_rect_width

This function takes a rectangle and returns a new rectangle with the given width but otherwise with the same edge points as the original rectangle.
Specification: dlib/geometry/rectangle_abstract.h
File to include: dlib/geometry.h
[top]

# running_stats

This object represents something that can compute the running mean and variance of a stream of real numbers.
Specification: dlib/statistics/statistics_abstract.h
File to include: dlib/statistics.h
Code Examples: 1
[top]

# rvm_regression_trainer

Trains a relevance vector machine for solving regression problems. Outputs a decision_function that represents the learned regression function.

The implementation of the RVM training algorithm used by this library is based on the following paper:

> Tipping, M. E. and A. C. Faul (2003). Fast marginal likelihood maximisation for sparse Bayesian models. In C. M. Bishop and B. J. Frey (Eds.), Proceedings of the Ninth International Workshop on Artificial Intelligence and Statistics, Key West, FL, Jan 3-6.

Specification: dlib/svm/rvm_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# rvm_trainer

Trains a relevance vector machine for solving binary classification problems. Outputs a decision_function that represents the learned classifier.

The implementation of the RVM training algorithm used by this library is based on the following paper:

> Tipping, M. E. and A. C. Faul (2003). Fast marginal likelihood maximisation for sparse Bayesian models. In C. M. Bishop and B. J. Frey (Eds.), Proceedings of the Ninth International Workshop on Artificial Intelligence and Statistics, Key West, FL, Jan 3-6.

Specification: dlib/svm/rvm_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# set_difference

This function takes two set objects and gives you their difference.
Specification: dlib/set_utils/set_utils_abstract.h
File to include: dlib/set_utils.h
[top]

# set_intersection

This function takes two set objects and gives you their intersection.
Specification: dlib/set_utils/set_utils_abstract.h
File to include: dlib/set_utils.h
[top]

# set_intersection_size

This function takes two set objects and tells you how many items they have in common.
Specification: dlib/set_utils/set_utils_abstract.h
File to include: dlib/set_utils.h
[top]

# set_node_as_evidence

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily set the evidence flag of a bayes_node when it is inside a directed_graph object.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1
[top]

# set_node_as_nonevidence

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily remove the evidence flag of a bayes_node when it is inside a directed_graph object.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1
[top]

# set_node_num_values

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily set the number of values of a bayes_node when it is inside a directed_graph object.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1
[top]

# set_node_probability

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily set the probability of a bayes_node given its parents when it is inside a directed_graph object.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1
[top]

# set_node_value

This is a function declared in the dlib::bayes_node_utils namespace. It is a convenience function that allows you to easily modify the value of a bayes_node when it is inside a directed_graph object.
Specification: dlib/bayes_utils/bayes_utils_abstract.h
File to include: dlib/bayes_utils.h
Code Examples: 1
[top]

# set_union

This function takes two set objects and gives you their union.
Specification: dlib/set_utils/set_utils_abstract.h
File to include: dlib/set_utils.h
[top]

# sigmoid_kernel

This object represents a sigmoid kernel for use with kernel learning machines.
Specification: dlib/svm/kernel_abstract.h
File to include: dlib/svm.h
[top]

# square_root

square_root is a function which takes an unsigned long and returns the square root of it or if the root is not an integer then it is rounded up to the next integer.
Specification: dlib/algs.h
File to include: dlib/algs.h
[top]

# svm_nu_trainer

Trains a nu support vector classifier and outputs a decision_function.

The implementation of the nu-svm training algorithm used by this library is based on the following excellent papers:

- Chang and Lin, Training {nu}-Support Vector Classifiers: Theory and Algorithms
- Chih-Chung Chang and Chih-Jen Lin, LIBSVM : a library for support vector machines, 2001. Software available at http://www.csie.ntu.edu.tw/~cjlin/libsvm

Specification: dlib/svm/svm_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# test_binary_decision_function

Tests a decision_function that represents a binary decision function and returns the test accuracy.
Specification: dlib/svm/svm_abstract.h
File to include: dlib/svm.h
[top]

# train_probabilistic_decision_function

Trains a probabilistic_decision_function using some sort of trainer object such as the svm_nu_trainer or rbf_network_trainer.

The probability model is created by using the technique described in the paper:

> Probabilistic Outputs for Support Vector Machines and Comparisons to Regularized Likelihood Methods by John C. Platt. Match 26, 1999

Specification: dlib/svm/svm_abstract.h
File to include: dlib/svm.h
Code Examples: 1
[top]

# translate_rect

This function takes a rectangle and moves it by a given number of units along the x and y axis relative to where it was before the move.
Specification: dlib/geometry/rectangle_abstract.h
File to include: dlib/geometry.h
[top]

# triangulate_graph_and_find_cliques

This function takes a graph and turns it into a chordal graph. It also returns a set that contains all the cliques present in the choral graph.
Specification: dlib/graph_utils/graph_utils_abstract.h
File to include: dlib/graph_utils.h
[top]

# vector

This object represents a three dimensional vector.
Specification: dlib/geometry/vector_abstract.h
File to include: dlib/geometry.h
[top]

# vector_normalizer

This object represents something that can learn to normalize a set of vectors. In particular, normalized vectors should have zero mean and a variance of one. Also, if desired, this object can also use principal component analysis for the purposes of reducing the number of elements in a vector.
Specification: dlib/statistics/statistics_abstract.h
File to include: dlib/statistics.h
Code Examples: 1