DecodeAI
← Question Bank

Deep Learning & Generative AI

Convolution Neural Networks

Interview questions on Convolution Neural Networks.

5 questions

Neural Style Transfer

Q1. Briefly describe how neural style transfer (NST) works?

Sign in to bookmark

Neural Style Transfer

Q2. Complete the sentence: When using the VGG-19 CNN for neural-style transfer, there different images are involved. Namely they are: `[...]`, `[...]` and `[...]`

Sign in to bookmark

Neural Style Transfer

Q3. Refer to below figure and answer the following questions: <table align='center'> <tr> <td align="center"> <img src="img/nst-1.png" alt= "Artistic style transfer using the style of Francis Picabia’s Udnie painting" style="max-width:70%;" /> </td> </tr> <tr> <td align="center">Artistic style transfer using the style of Francis Picabia’s Udnie painting</td> </tr> </table> 1. Which loss is being utilized during the training process? 2. Briefly describe the use of activations in the training process.

Sign in to bookmark

Neural Style Transfer

Q4. Still referring to above image: 1. How are the activations utilized in comparing the content of the content image to the content of the combined image? 2. How are the activations utilized in comparing the style of the content image to the style of the combined image?

Sign in to bookmark

Neural Style Transfer

Q5. Still referring to the image in **Q18**. For a new style transfer algorithm, a data scientist extracts a feature vector from an image using a pre-trained `ResNet34 CNN`. ```python import torchvision.models as models ... res_model = models.resnet34(pretrained=True) ``` He then defines the cosine similarity between two vectors: $u = {u_1,u_2,....,u_N}$ $v = {v_1,v_2,....,v_N}$ as:$$

Sign in to bookmark

sim(u, v) = \frac{u.v}{|u||v|} = \frac{\sum_{i=1}^Nu_iv_i}{\sqrt{(\sum_{i=1}^Nu_i^2)(\sum_{i=1}^Nv_i^2)}}

Thus,thecosinesimilaritybetweentwovectorsmeasuresthecosineoftheanglebetweenthevectorsirrespectiveoftheirmagnitude.Itiscalculatedasthedotproductoftwonumericvectors,andisnormalizedbytheproductofthelengthofthevectors.Answerthefollowingquestions:1.DefinethetermGrammatrix.2.ExplainindetailhowvectorsimilarityisutilisedinthecalculationoftheGrammatrixduringthetrainingofNST.Thus, the cosine similarity between two vectors measures the cosine of the angle between the vectors irrespective of their magnitude. It is calculated as the dot product of two numeric vectors, and is normalized by the product of the length of the vectors. Answer the following questions: 1. Define the term *Gram matrix*. 2. Explain in detail how vector similarity is utilised in the calculation of the Gram matrix during the training of *NST*.