   /// As hidden variable we use the "true" pose of the patch
   public typealias Hidden = Pose2
   
-  /// Initialize to uninitialized components
+  /// Initialize with the manually labeled images
   public init(_ data:[Datum], using sourceOfEntropy: inout AnyRandomNumberGenerator) {
     // We do an initial training of the encode with the manually labeled images
     let paches = data.map { $0.frame.patch(at: $0.manualLabel) }

  /// Given a datum and a model, sample from the hidden variables
  public func sample(count:Int, for datum: Datum,
                     using sourceOfEntropy: inout AnyRandomNumberGenerator) -> [Hidden] {
    let labels = [Hidden]()
    //    let labels : [Hidden] = (0..<count).map { _ in
    //      let u = Double.random(in: 0..<p1+p2, using: &sourceOfEntropy)

import TensorFlow
import XCTest

/// A likelihood model has a a feature encoder, a foreground model and a background model
public struct TrackingLikelihoodModel<Encoder: AppearanceModelEncoder, FG:GenerativeDensity, BG:GenerativeDensity> {
  public let encoder: Encoder
  public let foregroundModel: FG
  public let backgroundModel: BG
  
  /// A likelihood model is trained on image patches
  public init(encoder: Encoder, foregroundModel: FG,  backgroundModel: BG) {
    self.encoder = encoder
    self.foregroundModel = foregroundModel
