Python Forum
Read Tensorflow Documentation - Clarification
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read Tensorflow Documentation - Clarification
#1
Hello,

I am currently trying to work with tensorflow and keras and I have been following some tutorials while using the online documentation as well. (https://www.tensorflow.org/api_docs/python/tf/keras)
I have sort of written a walkthrough on how do I understand the dosumentation and I owuld like a feedback on my way of thinking please.


Here is one example of the ode:
model =  Sequential()
model.add(Conv2D(64, (3,3), input_shape = X.shape[1:]))
For this part of example, all the required modules are imported in the beginning:

import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D
I try to figure out how the above command is valid using the documentation.

As it shows, for keras, the only Classes are Sequential and Model and the rest are Modules.
Once you click on Sequential, it seems that it inherits everything (attributes and methods) from Method, Layer and Module as well as having some of its own methods as well.

We can see that
add
is one of its own methods and takes as input a layer instance. It is fair to assume that it refers to the layers module shown in the overview (link above)

In this case, an instance of the class Conv2D is created and that's all, right?


Questions

So, as far as I understand, the Modules in th overview, are Modules that are used for some of the Classes, they cannot be used in general and everywhere, right?

To import the Sequential class, I could have used
tf.keras.Sequential
instead, right?

Thank you in advance!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can I get some clarification on importing functions from external files. wh33t 3 897 Feb-25-2023, 08:07 PM
Last Post: deanhystad
  Looking for clarification related to performance Pymon 5 2,040 Apr-04-2022, 04:47 PM
Last Post: deanhystad
  *args implementation and clarification about tuple status amjass12 10 4,010 Jul-07-2021, 10:29 AM
Last Post: amjass12
  Just need some clarification Tonje 3 2,049 Oct-01-2020, 03:52 PM
Last Post: deanhystad
  Global Variables - Some Points Needing Clarification. adt 4 2,951 Nov-30-2019, 01:23 PM
Last Post: adt
  Clarification Hammuel 2 2,862 Oct-30-2017, 12:22 PM
Last Post: Hammuel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020