diff --git a/Sources/Accord.Statistics/Accord.Statistics.csproj b/Sources/Accord.Statistics/Accord.Statistics.csproj index 76acab3e0..d6a1fc9e0 100644 --- a/Sources/Accord.Statistics/Accord.Statistics.csproj +++ b/Sources/Accord.Statistics/Accord.Statistics.csproj @@ -354,6 +354,7 @@ + diff --git a/Sources/Accord.Statistics/Models/Markov/Learning/BaumWelchLearning`2.cs b/Sources/Accord.Statistics/Models/Markov/Learning/BaumWelchLearning`2.cs index 8bc231656..2feb52383 100644 --- a/Sources/Accord.Statistics/Models/Markov/Learning/BaumWelchLearning`2.cs +++ b/Sources/Accord.Statistics/Models/Markov/Learning/BaumWelchLearning`2.cs @@ -32,52 +32,6 @@ namespace Accord.Statistics.Models.Markov.Learning using Accord.MachineLearning; using Accord.Statistics.Models.Markov.Topology; - /// - /// Baum-Welch learning algorithms for learning Hidden Markov Models. - /// - /// - /// The type of the emission distributions in the model. - /// The type of the observations (i.e. int for a discrete model). - /// The type of fitting options accepted by this distribution. - /// - public class BaumWelchLearning : - BaseBaumWelchLearningOptions, TDistribution, TObservation, TOptions>, - IConvergenceLearning - where TDistribution : IFittableDistribution - where TOptions : class, IFittingOptions, new() - { - - /// - /// Initializes a new instance of the class. - /// - /// - public BaumWelchLearning() - { - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The model to be learned. - /// - public BaumWelchLearning(HiddenMarkovModel model) - : base(model) - { - } - - /// - /// Creates an instance of the model to be learned. Inheritors of this abstract - /// class must define this method so new models can be created from the training data. - /// - /// - protected override HiddenMarkovModel Create() - { - return new HiddenMarkovModel(Topology, Emissions); - } - - } - /// /// Baum-Welch learning algorithm for /// arbitrary-density (generic) Hidden Markov Models. @@ -184,7 +138,7 @@ protected override HiddenMarkovModel Create() /// /// /// - /// + /// /// /// The type of the emission distributions in the model. /// The type of the observations (i.e. int for a discrete model). diff --git a/Sources/Accord.Statistics/Models/Markov/Learning/BaumWelchLearning`3.cs b/Sources/Accord.Statistics/Models/Markov/Learning/BaumWelchLearning`3.cs new file mode 100644 index 0000000000..cc27bdb9e --- /dev/null +++ b/Sources/Accord.Statistics/Models/Markov/Learning/BaumWelchLearning`3.cs @@ -0,0 +1,79 @@ +// Accord Statistics Library +// The Accord.NET Framework +// http://accord-framework.net +// +// Copyright © César Souza, 2009-2017 +// cesarsouza at gmail.com +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// + +namespace Accord.Statistics.Models.Markov.Learning +{ + using Accord.Statistics.Models.Markov; + using Accord.Statistics.Distributions; + using Accord.Statistics.Distributions.Fitting; + + /// + /// Baum-Welch learning algorithms for learning Hidden Markov Models. + /// + /// + /// The type of the emission distributions in the model. + /// The type of the observations (i.e. int for a discrete model). + /// The type of fitting options accepted by this distribution. + /// + /// + /// Please see the documentation page for + /// the actual documentation of this class, including examples. + /// + /// + public class BaumWelchLearning : + BaseBaumWelchLearningOptions, TDistribution, TObservation, TOptions>, + IConvergenceLearning + where TDistribution : IFittableDistribution + where TOptions : class, IFittingOptions, new() + { + + /// + /// Initializes a new instance of the class. + /// + /// + public BaumWelchLearning() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The model to be learned. + /// + public BaumWelchLearning(HiddenMarkovModel model) + : base(model) + { + } + + /// + /// Creates an instance of the model to be learned. Inheritors of this abstract + /// class must define this method so new models can be created from the training data. + /// + /// + protected override HiddenMarkovModel Create() + { + return new HiddenMarkovModel(Topology, Emissions); + } + + } +}