question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The meaning of `isTrainable` property of a layer

See original GitHub issue

I am a bit confused about the meaning of isTrainable property of layers, so I decided to create this issue to ask for clarification.

In Keras, there is a boolean trainable attribute for each layer which indicates whether the weights of a layer (if it has any) should be updated during training or not (i.e. whether the layer is freezed or not during training). This is always set to True upon creation of the layer (even if the layer has no weights), unless the user explicitly set it to False. Now, if I am correct, its equivalent in KotlinDL is isTrainable property. From its docs (although, there is a typo: “… and could not be changed …”):

True, if layer’s weights could be changed during training. If false, layer’s weights are frozen and could be changed during the training.

But for the following layers, this property has been set to false:

This is a bit confusing to me, especially for layers with trainable weights (e.g. Conv3D). Am I missing something, or is this a bug? @zaleslaw

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
zaleslawcommented, Sep 20, 2021

Java API for TF used auto-generation to generate Java classes for exposed C API, and it regenerates from time to time (in the case of Java API for TF 2.x)

This corresponds to the ops generated in python, gen_nn_ops for example.

The next task - to implement the low-level logic written in python just in this package, and on this level a lot of missed things.

Gen_nn_ops, for example, are generated in the same way in Java and in Python, via api-defs, in both cases you get access to the underlying C++ code, I hope.

I could not say that the coverage is different for TF ops for TF 2.6 in Python or in Java API, but for example (of course, KotlinDL uses 1.15 and it contains a little bit fewer ops than 2.6), but if you mean not only generated ops, yes, at each high level we need to repeat the Python logic or write the same level of abstraction, for GradientTape, for Layers, for Losses and for control flow and so on.

If we will talk about probable obstacles/limitations, the honest answer is “I don’t know”. it looks like there are no obstacles, but I could not guarantee that.

0reactions
mkazecommented, Sep 19, 2021

@zaleslaw Thank you for your reply and explanations. I appreciate it.

But still I don’t understand why the coverage of TF Java API is limited compared to TF Python API? I mean is there any specific obstacle/limitation related to Java or the underlying C API of TF, or is it only because no one has invested enough time and effort to extend the TF Java API?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is Sustainable Architecture? - The Spruce
Sustainable architecture is a general term that refers to buildings designed to limit humanity's impact on the environment.
Read more >
Sustainable house
That is house which is energy efficient by itself, environmentally healthy, respectful for the natural environment, comfortable for family life, in other words ......
Read more >
25 Ways to Make Your Home Sustainable | Constellation
A sustainable house is built with low-impact, high-performance materials.They are efficient in terms of manufacturing, shipping and installing.
Read more >
Sustainable design - Wikipedia
Sustainable design seeks to reduce negative impacts on the environment, the health and well-being of building occupants, thereby improving building performance.
Read more >
Concrete's sustainable properties
Concrete is well adapted to a circular economy. Crushed concrete can be recycled as aggregates for newly produced concrete or be used as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found