Spread the word.

Share the link on social media.

Share
  • Facebook
Have an account? Sign In Now

Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

SIKSHAPATH

SIKSHAPATH Logo SIKSHAPATH Logo

SIKSHAPATH Navigation

  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Home/ Questions/Q 26815
Next
Answered

SIKSHAPATH Latest Questions

Saurav kumar
  • 0
  • 0
Saurav kumar
Asked: January 23, 20242024-01-23T20:54:15+05:30 2024-01-23T20:54:15+05:30In: Computer Science

TensorFlow-Advanced-Techniques-Specialization Week2

  • 0
  • 0

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?

TensorFlow-Advanced-Techniques-Specialization Week2

True

False

 

2.

Question 2

It is possible to add parameters to the object call when using the loss object.

TensorFlow-Advanced-Techniques-Specialization Week2

True

False

 

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?

TensorFlow-Advanced-Techniques-Specialization Week2

 

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.

 

 

4.

Question 4

One other way of implementing a custom loss function is by creating a class with two function definitions, init and call.

TensorFlow-Advanced-Techniques-Specialization Week2

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.

 

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:

TensorFlow-Advanced-Techniques-Specialization Week2

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.

and loss functions with tensorflowcustom modelslayersone of the ways of declaring a loss function is to import its object. is the following code correct for using a loss object?tensorflow-advanced-techniques-specialization
  • 1 1 Answer
  • 283 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. I'M ADMIN
      Best Answer
      I'M ADMIN
      2024-01-25T14:44:50+05:30Added an answer on January 25, 2024 at 2:44 pm

      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?

      TensorFlow-Advanced-Techniques-Specialization Week2

      True

      False

      Answer: False

       

      2.

      Question 2

      It is possible to add parameters to the object call when using the loss object.

      TensorFlow-Advanced-Techniques-Specialization Week2

      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?

      TensorFlow-Advanced-Techniques-Specialization Week2

       

      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.

      TensorFlow-Advanced-Techniques-Specialization Week2

      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:

      TensorFlow-Advanced-Techniques-Specialization Week2

      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.
        • 0
      • Reply
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    store ads

    Stats

    • Questions 1k
    • Answers 1k
    • Posts 149
    • Best Answers 89
    • This Free AI Tool Translates Entire Books in Minute !
    • AI News: 🎬 Hollywood’s AI Studios, 🎓 OpenAI’s Latest Gift to Educators, 🚚 Class8 Bags $22M, 🧠 Google Gemini’s Memory Upgrade
    • AI NEWS: Legal Action Against OpenAI, $16M Paid, & Elon Musk’s Praise from Investor 🤖💰📑 | AI Boosts Cloud Seeding for Water Security 🌱💧
    • AI News: 🎬AI Video Tool Scam Exposed🤯, 🛰️ AI-Powered Drones to Ukraine 😱, Google’s $20M AI Push, Sam Altman Joins SF’s Leadership Team
    • AI News: 🤝 Biden Meets Xi on AI Talks, 💡 Xavier Niel’s Advice for Europe, ♻️ Hong Kong’s Smart Bin Revolution, 🚀 AI x Huawei

    Explore

    • Recent Questions
    • Questions For You
    • Answers With Time
    • Most Visited
    • New Questions
    • Recent Questions With Time

    Footer

    SIKSHAPATH

    Helpful Links

    • Contact
    • Disclaimer
    • Privacy Policy Notice
    • TERMS OF USE
    • FAQs
    • Refund/Cancellation Policy
    • Delivery Policy for Sikshapath

    Follow Us

    © 2021-24 Sikshapath. All Rights Reserved

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.