I have been away for a while doing Deep Learning with Tensorflow in Python.
Python makes me miss type-safe functional programming, so I want to create a Scala wrapper for Tensorflow
At it’s core, Tensorflow is functional: Graphs transform Tensors of one shape into another shape. For example, one might represent an image as a 256x256x3 tensor (pixels x pixels x rgb). An image classifier graph might transform that into a 1000x1 tensor (scores for 1000 classes). One can make more complicated graphs by combining simple graphs.
I want to represent graphs as functions with a signature like f(T1): T2, where T1 and T2 encode the shape of the Tensor. One could then do Deep Learning by combining these functions.
Can anyone suggest a nice way to represent shape (e.g. 256x256x3) as a Type? Such a type needs to be parameterized with an seq of integers because each application has its own unique forms of data and network architecture.
I am looking for something like
def foo( Tensor( [256,256,3] )) : Tensor( [1000,1] )
Thanks in advance