 
   public let learningRate: LearningRate
   public let maxGradientNorm: Float?
+  public let rewardsPreprocessor: (Tensor<Float>) -> Tensor<Float>
   public let advantageFunction: AdvantageFunction
   public let useTDLambdaReturn: Bool
   public let clip: PPOClip?

    let finalValue = networkOutput.value[sequenceLength]

    // Estimate the advantages for the provided trajectory.
    let rewards = trajectory.reward[0..<sequenceLength]
    let advantageEstimate = advantageFunction(
      stepKinds: stepKinds,
      rewards: rewards,

    self.optimizer = optimizer(network)
    self.learningRate = learningRate
    self.maxGradientNorm = maxGradientNorm
    self.rewardsPreprocessor = rewardsPreprocessor
    self.advantageFunction = advantageFunction
    self.advantagesNormalizer = advantagesNormalizer
    self.useTDLambdaReturn = useTDLambdaReturn
