scalanlp/breeze

Optionally Encode Dimension in Types

Open

#526 geöffnet am 18. Apr. 2016

Auf GitHub ansehen
 (16 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Scala (690 Forks)batch import
help wantedproject

Repository-Metriken

Stars
 (3.453 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

One thing I found tedious is the runtime check the dimensionality match, for example, when writing a neural network, if you want to be safe, you need to check if the dimensionality of each layer matches, and when writing a single layer, you need to check if the multiple components of that layer have matching dimensions.

I am wondering if it's possible to encode the dimension in type so that such runtime check can be compiler time check? For example, I imagine it's possible to use Shapeless.Nat something like Matrix with D(_2, _3).

Perhaps this has been considered and deemed infeasible?

Contributor Guide