Richard Wei
Richard Wei
> I've attempted an implementation of an Embedding layer but am running into problems with the Layer protocol's input type requirements. Given that an Embedding layer consumes tensors of indices...
Specifying `@differentiable(wrt: self)` is not possible yet because the `Layer` protocol requires both `input` and `self` to be differentiable. There are definitely a lot of ways to resolve this, e.g....
> It just wouldn't compile as it relied on the `Raw.gather(params:, atIndices:)` function which requires a BinaryInteger for the second argument. Hope we can merge #151 so that you can...
Thanks for pointing that out. Fixed.
Ah yes, I used the wrong example here. What I really meant to change to demonstrate the verbosity is any setter indexing from `model`, which now becomes `model.allDifferentiableVariables[keyPath: kp] ...`....
Changed the protocol as I demonstrated above. We will discuss further if the verbosity becomes a concern.
Actually it starts to become a problem. `Differentiable.allDifferentiableVariables` should not be required to have a setter. See mailing list thread for reasons why that's the case: https://groups.google.com/a/tensorflow.org/d/msg/swift/HsPnSh4DFac/8511F4ENAQAJ. When that's fixed,...
If we use `State` as `Output`, both the output and the next state will have to be included as part of `State`. However, it is not ideal to always pass...
This can be done once we flesh out the property wrapper solution for parameters (along the lines of #250).
One problem with this approach is duplication for each variable type as you mentioned. A bigger problem is that you might include tensors that are not parameters of a model,...