optimizable-itf.h
Go to the documentation of this file.
1 // itf/optimizable-itf.h
2 
3 // Copyright 2009-2011 Go Vivace Inc.; Microsoft Corporation; Georg Stemmer
4 
5 // See ../../COPYING for clarification regarding multiple authors
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15 // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16 // MERCHANTABLITY OR NON-INFRINGEMENT.
17 // See the Apache 2 License for the specific language governing permissions and
18 // limitations under the License.
19 #ifndef KALDI_ITF_OPTIMIZABLE_ITF_H_
20 #define KALDI_ITF_OPTIMIZABLE_ITF_H_
21 
22 #include "base/kaldi-common.h"
23 #include "matrix/matrix-lib.h"
24 
25 namespace kaldi {
28 
35 template<class Real>
37  public:
40  virtual void ComputeGradient(const Vector<Real> &params,
41  Vector<Real> *gradient_out) = 0;
44  virtual Real ComputeValue(const Vector<Real> &params) = 0;
45 
46  virtual ~OptimizableInterface() {}
47 };
49 } // end namespace kaldi
50 
51 #endif
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
OptimizableInterface provides a virtual class for optimizable objects.
virtual Real ComputeValue(const Vector< Real > &params)=0
computes the function value for a parameter params and returns it
virtual void ComputeGradient(const Vector< Real > &params, Vector< Real > *gradient_out)=0
computes gradient for a parameter params and returns it in gradient_out
A class representing a vector.
Definition: kaldi-vector.h:406