From 71929f74cccb55773eb546fd23e5a3c9f730aa3d Mon Sep 17 00:00:00 2001 From: Dan Zheng Date: Mon, 6 Aug 2018 21:52:26 -0700 Subject: [PATCH] Make it clear that `P(0)` is zero initialization pseudocode --- proposals/ParameterUpdate.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/proposals/ParameterUpdate.md b/proposals/ParameterUpdate.md index 3e167baa4cc..367161a0e21 100644 --- a/proposals/ParameterUpdate.md +++ b/proposals/ParameterUpdate.md @@ -465,10 +465,9 @@ For example, an Adam optimizer implementation requires creating auxiliary variab struct AdamOptimizer

where ... { // There is one moving average per parameter. // Thus, the moving averages can be represented as an instance of `P`. - // Note: initializing `ParameterAggregate` types with zeros isn't possible, but - // is necessary in some form or another. This requires further exploration (like - // synthesizing conformances of `ParameterAggregate` types to `VectorNumeric`, which - // defines a repeating value initializer). + // Note: `P(0)` is pseudocode that initializes all members of `P` to 0. This + // kind of direct zero initialization isn't possible, but is used here to + // keep the example code simple. var movingAverages = P(0) mutating func fitParameters(