   public let klCutoffFactor: Float
   public let klCutoffCoefficient: Float
   public let adaptiveKLTarget: Float
-  public let adaptiveKLTolerance: Float
+  public let adaptiveKLToleranceFactor: Float
+  public let adaptiveKLBetaScalingFactor: Float
 
   public fileprivate(set) var adaptiveKLBeta: Float?
 

      let klDivergence = network(trajectory.observation).actionDistribution.klDivergence(
        to: actionDistribution)
      let klMean = klDivergence.mean().scalarized()
      if klMean < p.adaptiveKLTarget * (1 - p.adaptiveKLTolerance) {
        p.adaptiveKLBeta = max(beta / 1.5, 1e-16)
      } else if klMean > p.adaptiveKLTarget * (1 + p.adaptiveKLTolerance) {
        p.adaptiveKLBeta = max(beta * 1.5, 1e-16)
      }
    }


    klCutoffFactor: Float = 0.2,
    klCutoffCoefficient: Float = 1000.0,
    adaptiveKLTarget: Float = 0.01,
    adaptiveKLToleranceFactor: Float = 1.5,
    adaptiveKLBetaScalingFactor: Float = 2.0,
    adaptiveKLBeta: Float? = 1.0
  ) {
    precondition(adaptiveKLBetaScalingFactor > 0, "The beta scaling factor must be positive.")
    self.klCutoffFactor = klCutoffFactor
    self.klCutoffCoefficient = klCutoffCoefficient
    self.adaptiveKLTarget = adaptiveKLTarget
    self.adaptiveKLToleranceFactor = adaptiveKLToleranceFactor
    self.adaptiveKLBetaScalingFactor = adaptiveKLBetaScalingFactor
    self.adaptiveKLBeta = adaptiveKLBeta
  }
}
