Trying out new model implementation

19 views
Skip to first unread message

Hervé Guillemet

unread,
Jan 26, 2021, 1:22:42 PM1/26/21
to SIG JVM
Hello community,

I'm a newcomer to this project and would be interested in trying out implementing a model : DLA or one of its variation. I could send PR to the java-models repository if I get some success and if it might interest other people.

However, I'm wondering if the necessary bricks are already available. I'm thinking of:
- a deconvolution (transpose) layer. I didn't find anything in the current apidoc.
- the ability to freeze the weights of a layer or disable their update somehow.

I'm willing to contribute to add some of the missing bricks but would appreciate some directions.

---
Hervé


Jim Clarke

unread,
Jan 26, 2021, 2:03:13 PM1/26/21
to Hervé Guillemet, SIG JVM
Hervé,

Welcome aboard. 

I have started work on Layers, and have some Model plumbing done to support that,
but I haven’t created a PR for it yet. Layers are at least dependent on finishing metrics, 
and somewhat on  regularizers and constraints.

So far, most of the work has been focused on setting up components that the Model will end up using,
like losses, metrics, activations, initializers, etc.  We are close to finishing Metrics Phase 1, with Metrics Phase 2 
queued up right after that.  After metrics are done, I plan on submitting phase 1 of  layers (Input, Dense, Flatten, Dropout).
This will focus on the basic plumbing for layers, with many more layers planned for subsequent phases.
I have the phase 1 layers mostly done, but am waiting for any changes coming out the the Metrics PRs before
creating a PR for layers. Also, I just submitted PRs for constraints and regularizers this morning.


I have been basing my work on the Keras Sequential Model, with Model being the abstract base class,
and I am happy to share what I have done thus far.
How does your model work fit in with the Keras view of Model?
If you are interested in creating layers like Conv2D and Conv2DTranspose, etc., we could use all the help
we can get. Over all, there are about 80 layer classes defined in Keras.

jim
--
You received this message because you are subscribed to the Google Groups "SIG JVM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jvm+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/jvm/9a03756c-5e8a-4b89-b93a-d23c00627037n%40tensorflow.org.

Hervé Guillemet

unread,
Jan 28, 2021, 3:28:00 PM1/28/21
to Jim Clarke, SIG JVM
Le 26/01/2021 à 20:03, Jim Clarke a écrit :
>
> I have started work on Layers, and have some Model plumbing done to
> support that,
> but I haven’t created a PR for it yet. Layers are at least dependent on
> finishing metrics,
> and somewhat on  regularizers and constraints.
>
> So far, most of the work has been focused on setting up components that
> the Model will end up using,
> like losses, metrics, activations, initializers, etc.  We are close to
> finishing Metrics Phase 1, with Metrics Phase 2
> queued up right after that.  After metrics are done, I plan on
> submitting phase 1 of  layers (Input, Dense, Flatten, Dropout).
> This will focus on the basic plumbing for layers, with many more layers
> planned for subsequent phases.
> I have the phase 1 layers mostly done, but am waiting for
> any changes coming out the the Metrics PRs before
> creating a PR for layers. Also, I just submitted PRs for constraints and
> regularizers this morning.

Thanks for this summary of the current development state. It seems I'm
coming a bit early for implementing a full model.

> I have been basing my work on the Keras Sequential Model, with Model
> being the abstract base class,
> and I am happy to share what I have done thus far.
> How does your model work fit in with the Keras view of Model?

I'm no familiar with Keras, sorry. The models I'm interested in were
implemented by the original authors with PyTorch, and my own current
version is with DL4J.
The single remark I can think of this point is that it would be nice if
the Model class was designed to fit the common idea in the literature of
a backbone (abstract) network that could be extended/subclassed for
specific tasks (classification, segmentation, detection...) by adding
some output layers, choosing a loss function, etc...
Or maybe should we distinguish a graph of layers (like a network
backbone) and a model (having a particular task).
But I guess you already have a mind set about all this.

> If you are interested in creating layers like Conv2D and
> Conv2DTranspose, etc., we could use all the help
> we can get. Over all, there are about 80 layer classes defined in Keras.

Sure. I'd wait and have a look at your work on basic layers (like dense
layers) to see how I can derive other kind of layers.

--
Hervé

Adam Pocock

unread,
Jan 29, 2021, 2:26:58 PM1/29/21
to SIG JVM, herve.g...@gmail.com, SIG JVM, jimcla...@gmail.com
Hi Hervé,

It's worth noting that the operations to implement most of these things should already be present, it's just not wrapped up in a layer API. You can still build convolutional networks using the operators provided, but it will be more complicated than the Keras-style higher level API that's currently under construction. The current API is lower level than DL4J and pytorch, it's much more similar to TF 1.x without Keras.

That said, we are missing some gradients as they are only implemented in Python. Unfortunately it's not straightforward for us to find out the ops which are missing gradients, so it's mostly a case of building a graph and seeing if it throws an exception when you apply the gradient operator to it.

Thanks,

Adam

Reply all
Reply to author
Forward
0 new messages