Skip to content

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 23 Aug 04:08
· 67 commits to main since this release
c324789

AbstractNeuralNetworks v0.7.0

Diff since v0.6.4

Breaking changes

The parameter container moved to its own package (#33)

NeuralNetworkParameters is gone from this package. The container now lives in NeuralNetworkParameters.jl as NetworkParameters, along with the tree walks and the HDF5 path that used to be duplicated here. No alias is left behind, so that one type has one name across the ecosystem.

# before
using AbstractNeuralNetworks: NeuralNetworkParameters
# after
using NeuralNetworkParameters: NetworkParameters

NeuralNetwork now stores PT <: NetworkParameters. A model whose initialparameters returns a plain NamedTuple — a bare layer, for instance — cannot be stored in one, and now says so with an ArgumentError naming the model and the reason, instead of a MethodError against the inner constructor.

The recurrent cells were removed (#34)

Recurrent, LSTM, GRU, IdentityCell and GridCell are gone, along with src/cells/. They had not compiled against this package's own initialparameters interface since 0.6 and no test exercised them; GridCell additionally returned a Matrix of NamedTuples, which the parameter change above rules out. There is no replacement — the only consumer was GeometricMachineLearning, which is dropping its RecurrentNeuralNetwork/LSTMNeuralNetwork in step.

QPT and QPTOAT were removed (#31, #35)

These fixed a NamedTuple's keys to (:q, :p) — Hamiltonian phase-space vocabulary in a package that should not know what a Hamiltonian is. They are replaced by key-agnostic aliases:

# before
using AbstractNeuralNetworks: QPT, QPTOAT
# after
using AbstractNeuralNetworks: ArrayNamedTuple, ArrayOrNamedTuple

ArrayNamedTuple{T,S} is a NamedTuple of AbstractArray{T}; ArrayOrNamedTuple{T} is that or a bare array. Both are strictly wider than what they replace, so nothing that resolved before stops resolving. Neither is exported, matching the names they replace.

Bug fixes

  • Losses over a NamedTuple could not be differentiated. _norm/_diff had generic NamedTuple fallbacks that threw under Zygote — ChainRulesCore.ProjectTo has no method for the Vector the implementation collected — so in practice only the hardcoded (q, p) case worked. Every NamedTuple now differentiates, with values unchanged (#35).
  • A Chain refused any NamedTuple that was not (q, p). applychain is now generic in its input; a chain applies whatever its layers accept (#35).
  • Dense's initialparameters now accepts the keyword arguments Chain forwards to it, as Chain's docstring has always promised (#34).

Other

  • AbstractLayer{M,N} now declares its type parameters in the order everything uses them (M = input, N = output). Names only; no behaviour change (#34).

Merged pull requests:

Closed issues:

  • Remove Cells (#21)
  • Remove QPT and QPTOAT. (#31)