
A. class CustomEncoderLayer(nn.TransformerEncoderLayer):
def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, activation="relu"):
super().__init__(d_model, nhead, dim_feedforward, dropout, activation)
self.op = nn.Sigmoid()
def forward(self, src, src_mask = None, src_key_padding_mask = None, is_causal = False):
self.forward(src)
return self.op(encret)
B. class CustomEncoderLayer(nn.Module):
def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, activation="relu"):
self.op = nn.Sigmoid()
def forward(self, src, src_mask = None, src_key_padding_mask = None, is_causal = False):
encret = super().forward(src, src_mask, src_key_padding_mask, is_causal)
return self.op(encret)
C. class CustomEncoderLayer(nn.TransformerEncoderLayer):
def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, activation="relu"):
super().__init__(d_model, nhead, dim_feedforward, dropout, activation)
self.op = nn.Sigmoid()
def forward(self, src, src_mask = None, src_key_padding_mask = None, is_causal = False):
encret = super().forward(src, src_mask, src_key_padding_mask, is_causal)
return self.op(encret)
D. class CustomEncoderLayer(nn.Module):
def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, activation="relu"):
super().__init__(d_model, nhead, dim_feedforward, dropout, activation)
self.op = nn.Sigmoid()
def forward(self, src, src_mask = None, src_key_padding_mask = None, is_causal = False):
encret = super().forward(src, src_mask, src_key_padding_mask, is_causal)
return self.op(encret)
15. Consider an integer c ∈ [−2
p
, 2
p
− 1], we propose a modified binary representation of c, mbin(c) ∈
{0, 1}
p+1
as follows. The first bit (Most Significant Bit) in bin(c) is 0 (or 1) if c is non-negative (or,
negative). The following p bits are binary representation of |c| (prepended with 0’s, if necessary). For
example, consider p = 6 and c = −13; then mbin(−13) = 1001101. The first bit 1 stands for negative
sign in −13 and 001101 is six-bit binary representation of 13. An element from index i in mbin(c) can
be accessed using the notation mbin(c)[i] where i ∈ {0, 1, . . . , p}. Thus mbin(−13)[4] is 0.
Now, we need to implement the activation ReLU involving only logical operators (¬, ∨, ∧). Here, the
operators act element-wise, e.g. ¬101 = 010 and ¬101 ∨ 010 = 010. The which of the following is/are
true for ReLU(c) in mbin system:
(¬ mbin(c)[0])
p+1
∨ ¬ mbin(c).
✓ (¬ mbin(c)[p])
p+1
∧ mbin(c).
(¬ mbin(c)[0])
p+1
∨ mbin(c + 1).
(¬ mbin(c)[0])
p+1
∧ mbin(c + 1).
16. Which of the following option(s) is(are) correct?
GCN assigns unequal weights to the edges during performing neighborhood aggregation.
✓ GCN assigns equal weights to the edges during performing neighborhood aggre-
gation.
✓ Symmetric normalization of adjacency matrix is performed in GCN to avoid nu-
merical instability.
✓ Symmetric normalization of adjacency matrix is performed in GCN to make faster
the training convergence.
17. Which of these methods do not require a reward model?
A. PPO B. DPO C. GRPO D. None of the above.
18. Which of the following is not a tokenizer? Check all that applies
✓ VerbPiece UniGram. ✓ NGrams. SentencePiece. WordPiece.
Points earned: out of a possible 4 points