Shark machine learning library
Installation
Tutorials
Benchmarks
Documentation
Quick references
Class list
Global functions
include
shark
Algorithms
GradientDescent
BFGS.h
Go to the documentation of this file.
1
//===========================================================================
2
/*!
3
*
4
*
5
* \brief BFGS
6
*
7
* The Broyden, Fletcher, Goldfarb, Shannon (BFGS) algorithm is a
8
* quasi-Newton method for unconstrained real-valued optimization.
9
*
10
*
11
*
12
* \author O. Krause
13
* \date 2010
14
*
15
*
16
* \par Copyright 1995-2017 Shark Development Team
17
*
18
* <BR><HR>
19
* This file is part of Shark.
20
* <https://shark-ml.github.io/Shark/>
21
*
22
* Shark is free software: you can redistribute it and/or modify
23
* it under the terms of the GNU Lesser General Public License as published
24
* by the Free Software Foundation, either version 3 of the License, or
25
* (at your option) any later version.
26
*
27
* Shark is distributed in the hope that it will be useful,
28
* but WITHOUT ANY WARRANTY; without even the implied warranty of
29
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
* GNU Lesser General Public License for more details.
31
*
32
* You should have received a copy of the GNU Lesser General Public License
33
* along with Shark. If not, see <http://www.gnu.org/licenses/>.
34
*
35
*/
36
//===========================================================================
37
38
39
#ifndef SHARK_ALGORITHMS_GRADIENTDESCENT_BFGS_H
40
#define SHARK_ALGORITHMS_GRADIENTDESCENT_BFGS_H
41
42
#include <
shark/Algorithms/GradientDescent/AbstractLineSearchOptimizer.h
>
43
44
namespace
shark
{
45
46
/// \brief Broyden, Fletcher, Goldfarb, Shannon algorithm for unconstraint optimization
47
/// \ingroup gradientopt
48
template
<
class
SearchPo
int
Type = RealVector>
49
class
BFGS
:
public
AbstractLineSearchOptimizer
<SearchPointType>
50
{
51
public
:
52
typedef
typename
AbstractLineSearchOptimizer<SearchPointType>::ObjectiveFunctionType
ObjectiveFunctionType
;
53
protected
:
54
void
initModel
();
55
void
computeSearchDirection
(
ObjectiveFunctionType
const
&);
56
public
:
57
std::string
name
()
const
58
{
return
"BFGS"
; }
59
60
//from ISerializable
61
void
read
(
InArchive
& archive );
62
void
write
(
OutArchive
& archive )
const
;
63
protected
:
64
RealMatrix
m_hessian
;
65
};
66
67
//implementation is included in the library
68
extern
template
class
BFGS<RealVector>
;
69
extern
template
class
BFGS<FloatVector>
;
70
71
}
72
#endif