SciSharp / TensorFlow.NET

.NET Standard bindings for Google's TensorFlow for developing, training and deploying Machine Learning models in C# and F#.
https://scisharp.github.io/tensorflow-net-docs
Apache License 2.0
3.25k stars 523 forks source link

Adding Initializers, regularizers and new keras layers #1015

Open weezman opened 1 year ago

weezman commented 1 year ago

Description

Hello,

Great work on this library so far! I've been using it for a couple of weeks while implementing the PointNet model for 3d point cloud segmentation. Although I have 2 working implementations in Tensorflow and Torch for Python, I'd rather work in the .Net environ.

The Pointnet model has required extending Tensorflow.Net on a couple of fronts (of which I will check in after testing). New initializers (Constant), regularizers (OrthogonalRegularizer), and now an unimplemented keras.layer in the merging namespace. This would be keras.layers.Dot

The current keras.layers.reshape throws unimplemented for shapes where the second dimension is 'None' or Unknown in tensorflow.net. Looking here for any deeper reasons I can't create the Dot merge layer (inherit from Layer) considering my input tensors are None,None,3 and None,3,3 with an output of None,None,3 after the dot product merge operation. Was looking at linalg.tensordot but that does not support these batch unknown shapes.

inputs [Unknown,Unknown,3] transformed_features [None,3,3]

returns [None,None,3] layers.Dot(axes = (2, 1))([inputs, transformed_features])

Looking to add more features to this project as I work with models that supersede this one... PointNet++ and PointNeXt over the coming weeks.

Thanks!

Alternatives

No response