flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From HilmiYildirim <...@git.apache.org>
Subject [GitHub] flink pull request: [Flink-3007] Implemented a parallel version of...
Date Tue, 24 Nov 2015 10:15:04 GMT
Github user HilmiYildirim commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1350#discussion_r45716899
  
    --- Diff: flink-staging/flink-ml/src/main/scala/org/apache/flink/ml/optimization/BaumWelch.scala
---
    @@ -0,0 +1,346 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.flink.ml.optimization
    +
    +import org.apache.flink.api.common.functions.{RichFlatMapFunction, RichMapFunction, MapFunction}
    +import org.apache.flink.api.scala.{ExecutionEnvironment, DataSet}
    +import org.apache.flink.configuration.Configuration
    +import org.apache.flink.ml.classification.HMM
    +import org.apache.flink.ml.math.{DenseVector, DenseMatrix}
    +import org.apache.flink.util.Collector
    +import org.apache.flink.api.scala._
    +import org.slf4j.LoggerFactory
    +
    +/**
    + * Implementation of a parallel Baum-Welch algorithm based on the paper
    + * Lin, Jimmy, and Chris Dyer. "Data-intensive text processing with MapReduce.
    + * "Synthesis Lectures on Human Language Technologies 3.1 (2010): 1-177.
    + *
    + */
    +object BaumWelch {
    +
    +  /**
    +   * trains the Hidden Markov Model with the given number of iterations
    +   *
    +   * @param hmm Hidden Markov Model to train
    +   * @param observations observations which are used to train the Hidden Markov Model
    +   * @param numberOfIterations number of iterations to train the Hidden Markov Model
    +   */
    +  def train(hmm: HMM, observations: DataSet[Array[Int]], numberOfIterations: Int) {
    +    train(hmm, observations, hmm.initialProbabilities.size,
    +      hmm.emissionProbabilities.numCols, numberOfIterations)
    +  }
    +
    +  /**
    +   * trains the Hidden Markov Model with the given number of iterations
    --- End diff --
    
    I will add some more comments


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message