1. Question 1 One of the ways of declaring a loss function is to import its object. Is the following code correct for using a loss object? True False Answer: False 2. Question 2 It is possible to add parameters to the object call when using the loss object. True False Answer: True Read more
1.
Question 1
One of the ways of declaring a loss function is to import its object. Is the following code correct for using a loss object?
True
False
Answer: False
2.
Question 2
It is possible to add parameters to the object call when using the loss object.
True
False
Answer: True
3.
Question 3
You learned that you can do hyperparameter tuning within custom-built loss functions by creating a wrapper function around the loss function with hyperparameters defined as its parameter. What is the purpose of creating a wrapper function around the original loss function?
No particular reason, it just looks neater this way.
The loss ( model.compile(…, loss = ) ) expects a function that is only a wrapper function to the loss function itself.
That’s one way of doing it. We can also do the same by passing y_true, y_pred and threshold as parameters to the loss function itself.
The loss ( model.compile(…, loss = ) ) expects a function with two parameters, y_true and y_pred, so it is not possible to pass a 3rd parameter (threshold) to the loss function itself. This can be achieved by creating a wrapper function around the original loss function.
Answer:The loss ( model.compile(…, loss = ) ) expects a function with two parameters, y_true and y_pred, so it is not possible to pass a 3rd parameter (threshold) to the loss function itself. This can be achieved by creating a wrapper function around the original loss function.
4.
Question 4
One other way of implementing a custom loss function is by creating a class with two function definitions, init and call.
Which of the following is correct?
We pass y_true and y_pred to the init function, the hyperparameter (threshold) to the call function.
We pass the hyperparameter (threshold) , y_true and y_pred to the call function, and the init function returns the call function.
We pass the hyperparameter (threshold) to the init function, y_true and y_pred to the call function.
We pass the hyperparameter (threshold) , y_true and y_pred to the init function, and the call function returns the init function.
Answer:We pass the hyperparameter (threshold) to the init function, y_true and y_pred to the call function.
5.
Question 5
The formula for the contrastive loss, the function that is used in the siamese network for calculating image similarity, is defined as following:
Check all that are true:
If the euclidean distance between the pair of images is low then it means the images are similar.
Y is the tensor of details about image similarities.
Ds are 1 if images are similar, 0 if they are not.
Margin is a constant that we use to enforce a maximum distance between the two images in order to consider them similar or different from one another.
Answer:
Y is the tensor of details about image similarities.
If the euclidean distance between the pair of images is low then it means the images are similar.
Question 1 Which of these steps are needed for building a model with the Functional API? (Select three from the list below) Explicitly define an input layer to the model. Define the input layer of the model using any Keras layer class (e.g., Flatten(), Dense(), …) Define disconnected intermediate laRead more
Question 1
Which of these steps are needed for building a model with the Functional API? (Select three from the list below)
Explicitly define an input layer to the model.
Define the input layer of the model using any Keras layer class (e.g., Flatten(), Dense(), …)
Define disconnected intermediate layers of the model.
Connect each layer using python functional syntax.
Define the model using the input and output layers.
Define the model using only the output layer(s).
Answer:1, 4, 5(Answer)
Question 2
Is the following code correct for building a model with the Sequential API?
False
True
Answer:False
3.
Question 3
Only a single input layer can be defined for a functional model.
False
True
Answer: False
4.
Question 4
What are Branch Models ?
A model architecture with a single recurring path.
A model architecture where you can split the model into different paths, and cannot merge them later.
A model architecture with non-linear topology, shared layers, and even multiple inputs or outputs.
A model architecture with linear stack of layers.
Answer:A model architecture with non-linear topology, shared layers, and even multiple inputs or outputs.
5.
Question 5
One of the advantages of the Functional API is the option to build branched models with multiple outputs, where different loss functions can be implemented for each output.
True
False
Answer: True
6.
Question 6
A siamese network architecture has:
2 inputs, 2 outputs
1 input, 1 output
2 inputs, 1 output
1 input, 2 outputs
Answer: 2 inputs, 1 output
7.
Question 7
What is the output of each twin network inside a Siamese Network architecture?
A softmax probability
An output vector
Binary value, 1 or 0
A number
Answer:An output vector
8.
Question 8
What is the purpose of using a custom contrastive loss function for a siamese model?
A custom loss function is required for using the RMSprop() optimizer.
As a custom built function, it provides better results and it is faster to run.
A custom built function is required because it is not possible to use a built-in loss function with the Lambda layer.
It is a custom built function that can calculate the loss on similarity comparison between two items.
Answer: It is a custom built function that can calculate the loss on similarity comparison between two items.
To evaluate the maximum number of pages required when a system supports a 16-bit address line and a 1K (1024 Bytes) page size, we can break it down as follows: 16-bit Address Line: A 16-bit address line can address up to 216 locations (bytes). Page Size: Given a page size of 1K, which is equivalentRead more
To evaluate the maximum number of pages required when a system supports a 16-bit address line and a 1K (1024 Bytes) page size, we can break it down as follows:
16-bit Address Line:
A 16-bit address line can address up to 216 locations (bytes).
Page Size:
Given a page size of 1K, which is equivalent to 1024 Bytes (Ref: 1 KB = 1024 Bytes).
Now, calculate the maximum number of pages needed:
Total Addressable Locations= 216= 65536 locations.
Page Size = 1024 Bytes.
To find the total number of pages, divide the total addressable locations by the page size:
Total Pages= Total Addressable Locations/Page Size= 65536/1024= 64 pages.
Hence, in a system with a 16-bit address line and a 1K page size, the maximum number of pages required is 64.
There are mainly four Levels of Testing in software testing : 1. Unit Testing : checks if software components are fulfilling functionalities or not. 2. Integration Testing : checks the data flow from one module to other modules. 3. System Testing : evaluates both functional and non-functional needsRead more
There are mainly four Levels of Testing in software testing :
1. Unit Testing : checks if software components are fulfilling functionalities or not.
2. Integration Testing : checks the data flow from one module to other modules.
3. System Testing : evaluates both functional and non-functional needs for the testing.
4. Acceptance Testing : checks the requirements of a specification or contract are met as per its delivery.
A Unit is a smallest testable portion of system or application which can be compiled, liked, loaded, and executed. This kind of testing helps to test each module separately.The aim is to test each part of the software by separating it. It checks that component are fulfilling functionalities or not. This kind of testing is performed by developers.
Integration means combining. For Example, In this testing phase, different software modules are combined and tested as a group to make sure that integrated system is ready for system testing.
Integrating testing checks the data flow from one module to other modules. This kind of testing is performed by testers.
System testing is performed on a complete, integrated system. It allows checking system’s compliance as per the requirements. It tests the overall interaction of components. It involves load, performance, reliability and security testing.
System testing most often the final test to verify that the system meets the specification. It evaluates both functional and non-functional need for the testing.
Acceptance testing is a test conducted to find if the requirements of a specification or contract are met as per its delivery. Acceptance testing is basically done by the user or customer. However, other stockholders can be involved in this process.
TensorFlow-Advanced-Techniques-Specialization Week2
1. Question 1 One of the ways of declaring a loss function is to import its object. Is the following code correct for using a loss object? True False Answer: False 2. Question 2 It is possible to add parameters to the object call when using the loss object. True False Answer: True Read more
1.
Question 1
One of the ways of declaring a loss function is to import its object. Is the following code correct for using a loss object?
True
False
Answer: False
2.
Question 2
It is possible to add parameters to the object call when using the loss object.
True
False
Answer: True
3.
Question 3
You learned that you can do hyperparameter tuning within custom-built loss functions by creating a wrapper function around the loss function with hyperparameters defined as its parameter. What is the purpose of creating a wrapper function around the original loss function?
No particular reason, it just looks neater this way.
The loss ( model.compile(…, loss = ) ) expects a function that is only a wrapper function to the loss function itself.
That’s one way of doing it. We can also do the same by passing y_true, y_pred and threshold as parameters to the loss function itself.
The loss ( model.compile(…, loss = ) ) expects a function with two parameters, y_true and y_pred, so it is not possible to pass a 3rd parameter (threshold) to the loss function itself. This can be achieved by creating a wrapper function around the original loss function.
Answer: The loss ( model.compile(…, loss = ) ) expects a function with two parameters, y_true and y_pred, so it is not possible to pass a 3rd parameter (threshold) to the loss function itself. This can be achieved by creating a wrapper function around the original loss function.
4.
Question 4
One other way of implementing a custom loss function is by creating a class with two function definitions, init and call.
Which of the following is correct?
We pass y_true and y_pred to the init function, the hyperparameter (threshold) to the call function.
We pass the hyperparameter (threshold) , y_true and y_pred to the call function, and the init function returns the call function.
We pass the hyperparameter (threshold) to the init function, y_true and y_pred to the call function.
We pass the hyperparameter (threshold) , y_true and y_pred to the init function, and the call function returns the init function.
Answer:We pass the hyperparameter (threshold) to the init function, y_true and y_pred to the call function.
5.
Question 5
The formula for the contrastive loss, the function that is used in the siamese network for calculating image similarity, is defined as following:
Check all that are true:
If the euclidean distance between the pair of images is low then it means the images are similar.
Y is the tensor of details about image similarities.
Ds are 1 if images are similar, 0 if they are not.
Margin is a constant that we use to enforce a maximum distance between the two images in order to consider them similar or different from one another.
Answer:
TensorFlow Advanced Techniques Specialization Week 1
Question 1 Which of these steps are needed for building a model with the Functional API? (Select three from the list below) Explicitly define an input layer to the model. Define the input layer of the model using any Keras layer class (e.g., Flatten(), Dense(), …) Define disconnected intermediate laRead more
Question 1
Which of these steps are needed for building a model with the Functional API? (Select three from the list below)
Explicitly define an input layer to the model.
Define the input layer of the model using any Keras layer class (e.g., Flatten(), Dense(), …)
Define disconnected intermediate layers of the model.
Connect each layer using python functional syntax.
Define the model using the input and output layers.
Define the model using only the output layer(s).
Answer: 1, 4, 5(Answer)
Question 2
Is the following code correct for building a model with the Sequential API?
False
True
Answer:False
3.
Question 3
Only a single input layer can be defined for a functional model.
False
True
Answer: False
4.
Question 4
What are Branch Models ?
A model architecture with a single recurring path.
A model architecture where you can split the model into different paths, and cannot merge them later.
A model architecture with non-linear topology, shared layers, and even multiple inputs or outputs.
A model architecture with linear stack of layers.
Answer:A model architecture with non-linear topology, shared layers, and even multiple inputs or outputs.
5.
Question 5
One of the advantages of the Functional API is the option to build branched models with multiple outputs, where different loss functions can be implemented for each output.
True
False
Answer: True
6.
Question 6
A siamese network architecture has:
2 inputs, 2 outputs
1 input, 1 output
2 inputs, 1 output
1 input, 2 outputs
Answer: 2 inputs, 1 output
7.
Question 7
What is the output of each twin network inside a Siamese Network architecture?
A softmax probability
An output vector
Binary value, 1 or 0
A number
Answer:An output vector
8.
Question 8
What is the purpose of using a custom contrastive loss function for a siamese model?
A custom loss function is required for using the RMSprop() optimizer.
As a custom built function, it provides better results and it is faster to run.
A custom built function is required because it is not possible to use a built-in loss function with the Lambda layer.
It is a custom built function that can calculate the loss on similarity comparison between two items.
Answer: It is a custom built function that can calculate the loss on similarity comparison between two items.
Evaluating the maximum number of pages needed, if a system supports 16 bit address line and 1K page size
To evaluate the maximum number of pages required when a system supports a 16-bit address line and a 1K (1024 Bytes) page size, we can break it down as follows: 16-bit Address Line: A 16-bit address line can address up to 216 locations (bytes). Page Size: Given a page size of 1K, which is equivalentRead more
To evaluate the maximum number of pages required when a system supports a 16-bit address line and a 1K (1024 Bytes) page size, we can break it down as follows:
16-bit Address Line:
Page Size:
Now, calculate the maximum number of pages needed:
Total Addressable Locations= 216= 65536 locations.
Page Size = 1024 Bytes.
To find the total number of pages, divide the total addressable locations by the page size:
Total Pages= Total Addressable Locations/Page Size= 65536/1024= 64 pages.
Hence, in a system with a 16-bit address line and a 1K page size, the maximum number of pages required is 64.
See lessWrite a Python program to generate 26 text files …
Vote up the answer to support For the answer download the given attachment:
Vote up the answer to support
For the answer download the given attachment:
See lessDescribe the two levels of testing? List various testing activities?
There are mainly four Levels of Testing in software testing : 1. Unit Testing : checks if software components are fulfilling functionalities or not. 2. Integration Testing : checks the data flow from one module to other modules. 3. System Testing : evaluates both functional and non-functional needsRead more
There are mainly four Levels of Testing in software testing :
1. Unit Testing : checks if software components are fulfilling functionalities or not.
2. Integration Testing : checks the data flow from one module to other modules.
3. System Testing : evaluates both functional and non-functional needs for the testing.
4. Acceptance Testing : checks the requirements of a specification or contract are met as per its delivery.
1) Unit testing:
A Unit is a smallest testable portion of system or application which can be compiled, liked, loaded, and executed. This kind of testing helps to test each module separately.The aim is to test each part of the software by separating it. It checks that component are fulfilling functionalities or not. This kind of testing is performed by developers.
2) Integration testing:
Integration means combining. For Example, In this testing phase, different software modules are combined and tested as a group to make sure that integrated system is ready for system testing.
Integrating testing checks the data flow from one module to other modules. This kind of testing is performed by testers.
3) System testing:
System testing is performed on a complete, integrated system. It allows checking system’s compliance as per the requirements. It tests the overall interaction of components. It involves load, performance, reliability and security testing.
System testing most often the final test to verify that the system meets the specification. It evaluates both functional and non-functional need for the testing.
4) Acceptance testing:
Acceptance testing is a test conducted to find if the requirements of a specification or contract are met as per its delivery. Acceptance testing is basically done by the user or customer. However, other stockholders can be involved in this process.
Other Types of Testing:
If the address of A[1][1] and A[2][1] are 1000 and 1010 respectively …
Answer: c. row major
Answer: c. row major
See less