SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
3. (a) Consider the self-attention operation S(X) defined as follows AS(X)t,:=1XWqWkTXT=
softmax(At,:)XWv Where XRTDin,WvRDinDk,WkRDinDk,WqRDinDk.Din being the input
dimensionality and T a sequence (or set) length (b) (15 points) Show that for any permutation
matrix P,PS(X)=S(PX) (c) (5 points) We would like to use S(X) and a linear operation to construct
a permutation invariant function G(X) that outputs the same feature representation for any ordering
of the input sequence (hence, it is invariant to the input's arrangement). What linear operation can
we use? Specifically find an example of a vector w such that G(X)=wTS(X) satisfies the condition
G(X)=G(PX) for all permutation matrix P. (d) (15 points) Consider a batched ZRBTD that is for
example the output of a self-attention layer. Implement a nn.module or python function using
functionalize that takes Z and applies a "Position wise feedforward network" layer, H(x)=relu(W1x+
b) which outputs a tensor of size RBTD as commonly used in transformer models. Implement this
in two ways (1) using nn. Linear and (2) using nn. Conv1d with padding 0 , stride 1 and kernel size
1 . Validate your implementations match with an assert statement. You may select a random Z
with the size B,T,D of your choosing for validating your implementation.

Contenu connexe

Similaire à 3 a Consider the selfattention operation SX defined as.pdf

Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...mathsjournal
 
Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...mathsjournal
 
Code of the Multidimensional Fractional Quasi-Newton Method using Recursive P...
Code of the Multidimensional Fractional Quasi-Newton Method using Recursive P...Code of the Multidimensional Fractional Quasi-Newton Method using Recursive P...
Code of the Multidimensional Fractional Quasi-Newton Method using Recursive P...mathsjournal
 
(DL hacks輪読)Bayesian Neural Network
(DL hacks輪読)Bayesian Neural Network(DL hacks輪読)Bayesian Neural Network
(DL hacks輪読)Bayesian Neural NetworkMasahiro Suzuki
 
Random variable, distributive function lect3a.ppt
Random variable, distributive function lect3a.pptRandom variable, distributive function lect3a.ppt
Random variable, distributive function lect3a.pptsadafshahbaz7777
 
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and SystemsDSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and SystemsAmr E. Mohamed
 
Fixed points theorem on a pair of random generalized non linear contractions
Fixed points theorem on a pair of random generalized non linear contractionsFixed points theorem on a pair of random generalized non linear contractions
Fixed points theorem on a pair of random generalized non linear contractionsAlexander Decker
 
Recurrent and Recursive Networks (Part 1)
Recurrent and Recursive Networks (Part 1)Recurrent and Recursive Networks (Part 1)
Recurrent and Recursive Networks (Part 1)sohaib_alam
 
statistical computation using R- an intro..
statistical computation using R- an intro..statistical computation using R- an intro..
statistical computation using R- an intro..Kamarudheen KV
 
Fixed Point Theorm In Probabilistic Analysis
Fixed Point Theorm In Probabilistic AnalysisFixed Point Theorm In Probabilistic Analysis
Fixed Point Theorm In Probabilistic Analysisiosrjce
 
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisDSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisAmr E. Mohamed
 
ch9.pdf
ch9.pdfch9.pdf
ch9.pdfKavS14
 
Contribution of Fixed Point Theorem in Quasi Metric Spaces
Contribution of Fixed Point Theorem in Quasi Metric SpacesContribution of Fixed Point Theorem in Quasi Metric Spaces
Contribution of Fixed Point Theorem in Quasi Metric SpacesAM Publications,India
 
Vitaly Vanchurin "General relativity from non-equilibrium thermodynamics of q...
Vitaly Vanchurin "General relativity from non-equilibrium thermodynamics of q...Vitaly Vanchurin "General relativity from non-equilibrium thermodynamics of q...
Vitaly Vanchurin "General relativity from non-equilibrium thermodynamics of q...SEENET-MTP
 

Similaire à 3 a Consider the selfattention operation SX defined as.pdf (20)

Disjoint sets
Disjoint setsDisjoint sets
Disjoint sets
 
Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...
 
Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...Code of the multidimensional fractional pseudo-Newton method using recursive ...
Code of the multidimensional fractional pseudo-Newton method using recursive ...
 
Random Variable
Random Variable Random Variable
Random Variable
 
Code of the Multidimensional Fractional Quasi-Newton Method using Recursive P...
Code of the Multidimensional Fractional Quasi-Newton Method using Recursive P...Code of the Multidimensional Fractional Quasi-Newton Method using Recursive P...
Code of the Multidimensional Fractional Quasi-Newton Method using Recursive P...
 
(DL hacks輪読)Bayesian Neural Network
(DL hacks輪読)Bayesian Neural Network(DL hacks輪読)Bayesian Neural Network
(DL hacks輪読)Bayesian Neural Network
 
Random variable, distributive function lect3a.ppt
Random variable, distributive function lect3a.pptRandom variable, distributive function lect3a.ppt
Random variable, distributive function lect3a.ppt
 
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and SystemsDSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
 
Fixed points theorem on a pair of random generalized non linear contractions
Fixed points theorem on a pair of random generalized non linear contractionsFixed points theorem on a pair of random generalized non linear contractions
Fixed points theorem on a pair of random generalized non linear contractions
 
Recurrent and Recursive Networks (Part 1)
Recurrent and Recursive Networks (Part 1)Recurrent and Recursive Networks (Part 1)
Recurrent and Recursive Networks (Part 1)
 
statistical computation using R- an intro..
statistical computation using R- an intro..statistical computation using R- an intro..
statistical computation using R- an intro..
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
 
Fixed Point Theorm In Probabilistic Analysis
Fixed Point Theorm In Probabilistic AnalysisFixed Point Theorm In Probabilistic Analysis
Fixed Point Theorm In Probabilistic Analysis
 
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisDSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
 
ch9.pdf
ch9.pdfch9.pdf
ch9.pdf
 
Matlab
MatlabMatlab
Matlab
 
Contribution of Fixed Point Theorem in Quasi Metric Spaces
Contribution of Fixed Point Theorem in Quasi Metric SpacesContribution of Fixed Point Theorem in Quasi Metric Spaces
Contribution of Fixed Point Theorem in Quasi Metric Spaces
 
Vitaly Vanchurin "General relativity from non-equilibrium thermodynamics of q...
Vitaly Vanchurin "General relativity from non-equilibrium thermodynamics of q...Vitaly Vanchurin "General relativity from non-equilibrium thermodynamics of q...
Vitaly Vanchurin "General relativity from non-equilibrium thermodynamics of q...
 
Adaptive dynamic programming algorithm for uncertain nonlinear switched systems
Adaptive dynamic programming algorithm for uncertain nonlinear switched systemsAdaptive dynamic programming algorithm for uncertain nonlinear switched systems
Adaptive dynamic programming algorithm for uncertain nonlinear switched systems
 
residue
residueresidue
residue
 

Plus de acutekcorp

3 Consider everything youve learned in about changes in DN.pdf
3 Consider everything youve learned in about changes in DN.pdf3 Consider everything youve learned in about changes in DN.pdf
3 Consider everything youve learned in about changes in DN.pdfacutekcorp
 
3 Consider the table of cell means from a balanced 2way AN.pdf
3 Consider the table of cell means from a balanced 2way AN.pdf3 Consider the table of cell means from a balanced 2way AN.pdf
3 Consider the table of cell means from a balanced 2way AN.pdfacutekcorp
 
3 Alice and Bob buy a bag of apples which contains 10 good.pdf
3 Alice and Bob buy a bag of apples which contains 10 good.pdf3 Alice and Bob buy a bag of apples which contains 10 good.pdf
3 Alice and Bob buy a bag of apples which contains 10 good.pdfacutekcorp
 
3 Carbon Dioxide CO2 combines with Water H2O in the blo.pdf
3 Carbon Dioxide CO2 combines with Water H2O in the blo.pdf3 Carbon Dioxide CO2 combines with Water H2O in the blo.pdf
3 Carbon Dioxide CO2 combines with Water H2O in the blo.pdfacutekcorp
 
3 Con base en todo lo que sabemos sobre los mundos terrestr.pdf
3 Con base en todo lo que sabemos sobre los mundos terrestr.pdf3 Con base en todo lo que sabemos sobre los mundos terrestr.pdf
3 Con base en todo lo que sabemos sobre los mundos terrestr.pdfacutekcorp
 
3 Consider a large population with so many subpopulations t.pdf
3 Consider a large population with so many subpopulations t.pdf3 Consider a large population with so many subpopulations t.pdf
3 Consider a large population with so many subpopulations t.pdfacutekcorp
 
3 Calculating GDP from raw economic data The following tabl.pdf
3 Calculating GDP from raw economic data The following tabl.pdf3 Calculating GDP from raw economic data The following tabl.pdf
3 Calculating GDP from raw economic data The following tabl.pdfacutekcorp
 
3 Calculate the Following and Explain their significance .pdf
3 Calculate the Following and Explain their significance  .pdf3 Calculate the Following and Explain their significance  .pdf
3 Calculate the Following and Explain their significance .pdfacutekcorp
 
3 Caesar Cipher 1 You are given a message halloween and a.pdf
3 Caesar Cipher 1 You are given a message halloween and a.pdf3 Caesar Cipher 1 You are given a message halloween and a.pdf
3 Caesar Cipher 1 You are given a message halloween and a.pdfacutekcorp
 
3 Bob and Kelly are business partners at the firm of Dewey .pdf
3 Bob and Kelly are business partners at the firm of Dewey .pdf3 Bob and Kelly are business partners at the firm of Dewey .pdf
3 Bob and Kelly are business partners at the firm of Dewey .pdfacutekcorp
 
3 All the events that occur in prophase of mitosis also occ.pdf
3 All the events that occur in prophase of mitosis also occ.pdf3 All the events that occur in prophase of mitosis also occ.pdf
3 All the events that occur in prophase of mitosis also occ.pdfacutekcorp
 
3 According to a company news release during the third qua.pdf
3 According to a company news release during the third qua.pdf3 According to a company news release during the third qua.pdf
3 According to a company news release during the third qua.pdfacutekcorp
 
3 A tropical fish fancier produced an albino zebra fish It.pdf
3 A tropical fish fancier produced an albino zebra fish It.pdf3 A tropical fish fancier produced an albino zebra fish It.pdf
3 A tropical fish fancier produced an albino zebra fish It.pdfacutekcorp
 
3 8 pts Consider the Bayes Net given below For a given e.pdf
3 8 pts Consider the Bayes Net given below For a given e.pdf3 8 pts Consider the Bayes Net given below For a given e.pdf
3 8 pts Consider the Bayes Net given below For a given e.pdfacutekcorp
 
3 4 pts Your instructor has presented you with a yery dar.pdf
3 4 pts Your instructor has presented you with a yery dar.pdf3 4 pts Your instructor has presented you with a yery dar.pdf
3 4 pts Your instructor has presented you with a yery dar.pdfacutekcorp
 
3 5 points Refer to the following worksheet The followin.pdf
3 5 points Refer to the following worksheet The followin.pdf3 5 points Refer to the following worksheet The followin.pdf
3 5 points Refer to the following worksheet The followin.pdfacutekcorp
 
3 31030 points Use the Master Theorem to find the comple.pdf
3 31030 points Use the Master Theorem to find the comple.pdf3 31030 points Use the Master Theorem to find the comple.pdf
3 31030 points Use the Master Theorem to find the comple.pdfacutekcorp
 
3 a 2 pts For XPois find EX the average factoria.pdf
3 a 2 pts For XPois find EX the average factoria.pdf3 a 2 pts For XPois find EX the average factoria.pdf
3 a 2 pts For XPois find EX the average factoria.pdfacutekcorp
 
3 174 attempt Topic time series models Questions i You .pdf
3 174 attempt Topic time series models Questions i You .pdf3 174 attempt Topic time series models Questions i You .pdf
3 174 attempt Topic time series models Questions i You .pdfacutekcorp
 
3 10 Write a short JAVA method to count the number of nod.pdf
3 10 Write a short JAVA method to count the number of nod.pdf3 10 Write a short JAVA method to count the number of nod.pdf
3 10 Write a short JAVA method to count the number of nod.pdfacutekcorp
 

Plus de acutekcorp (20)

3 Consider everything youve learned in about changes in DN.pdf
3 Consider everything youve learned in about changes in DN.pdf3 Consider everything youve learned in about changes in DN.pdf
3 Consider everything youve learned in about changes in DN.pdf
 
3 Consider the table of cell means from a balanced 2way AN.pdf
3 Consider the table of cell means from a balanced 2way AN.pdf3 Consider the table of cell means from a balanced 2way AN.pdf
3 Consider the table of cell means from a balanced 2way AN.pdf
 
3 Alice and Bob buy a bag of apples which contains 10 good.pdf
3 Alice and Bob buy a bag of apples which contains 10 good.pdf3 Alice and Bob buy a bag of apples which contains 10 good.pdf
3 Alice and Bob buy a bag of apples which contains 10 good.pdf
 
3 Carbon Dioxide CO2 combines with Water H2O in the blo.pdf
3 Carbon Dioxide CO2 combines with Water H2O in the blo.pdf3 Carbon Dioxide CO2 combines with Water H2O in the blo.pdf
3 Carbon Dioxide CO2 combines with Water H2O in the blo.pdf
 
3 Con base en todo lo que sabemos sobre los mundos terrestr.pdf
3 Con base en todo lo que sabemos sobre los mundos terrestr.pdf3 Con base en todo lo que sabemos sobre los mundos terrestr.pdf
3 Con base en todo lo que sabemos sobre los mundos terrestr.pdf
 
3 Consider a large population with so many subpopulations t.pdf
3 Consider a large population with so many subpopulations t.pdf3 Consider a large population with so many subpopulations t.pdf
3 Consider a large population with so many subpopulations t.pdf
 
3 Calculating GDP from raw economic data The following tabl.pdf
3 Calculating GDP from raw economic data The following tabl.pdf3 Calculating GDP from raw economic data The following tabl.pdf
3 Calculating GDP from raw economic data The following tabl.pdf
 
3 Calculate the Following and Explain their significance .pdf
3 Calculate the Following and Explain their significance  .pdf3 Calculate the Following and Explain their significance  .pdf
3 Calculate the Following and Explain their significance .pdf
 
3 Caesar Cipher 1 You are given a message halloween and a.pdf
3 Caesar Cipher 1 You are given a message halloween and a.pdf3 Caesar Cipher 1 You are given a message halloween and a.pdf
3 Caesar Cipher 1 You are given a message halloween and a.pdf
 
3 Bob and Kelly are business partners at the firm of Dewey .pdf
3 Bob and Kelly are business partners at the firm of Dewey .pdf3 Bob and Kelly are business partners at the firm of Dewey .pdf
3 Bob and Kelly are business partners at the firm of Dewey .pdf
 
3 All the events that occur in prophase of mitosis also occ.pdf
3 All the events that occur in prophase of mitosis also occ.pdf3 All the events that occur in prophase of mitosis also occ.pdf
3 All the events that occur in prophase of mitosis also occ.pdf
 
3 According to a company news release during the third qua.pdf
3 According to a company news release during the third qua.pdf3 According to a company news release during the third qua.pdf
3 According to a company news release during the third qua.pdf
 
3 A tropical fish fancier produced an albino zebra fish It.pdf
3 A tropical fish fancier produced an albino zebra fish It.pdf3 A tropical fish fancier produced an albino zebra fish It.pdf
3 A tropical fish fancier produced an albino zebra fish It.pdf
 
3 8 pts Consider the Bayes Net given below For a given e.pdf
3 8 pts Consider the Bayes Net given below For a given e.pdf3 8 pts Consider the Bayes Net given below For a given e.pdf
3 8 pts Consider the Bayes Net given below For a given e.pdf
 
3 4 pts Your instructor has presented you with a yery dar.pdf
3 4 pts Your instructor has presented you with a yery dar.pdf3 4 pts Your instructor has presented you with a yery dar.pdf
3 4 pts Your instructor has presented you with a yery dar.pdf
 
3 5 points Refer to the following worksheet The followin.pdf
3 5 points Refer to the following worksheet The followin.pdf3 5 points Refer to the following worksheet The followin.pdf
3 5 points Refer to the following worksheet The followin.pdf
 
3 31030 points Use the Master Theorem to find the comple.pdf
3 31030 points Use the Master Theorem to find the comple.pdf3 31030 points Use the Master Theorem to find the comple.pdf
3 31030 points Use the Master Theorem to find the comple.pdf
 
3 a 2 pts For XPois find EX the average factoria.pdf
3 a 2 pts For XPois find EX the average factoria.pdf3 a 2 pts For XPois find EX the average factoria.pdf
3 a 2 pts For XPois find EX the average factoria.pdf
 
3 174 attempt Topic time series models Questions i You .pdf
3 174 attempt Topic time series models Questions i You .pdf3 174 attempt Topic time series models Questions i You .pdf
3 174 attempt Topic time series models Questions i You .pdf
 
3 10 Write a short JAVA method to count the number of nod.pdf
3 10 Write a short JAVA method to count the number of nod.pdf3 10 Write a short JAVA method to count the number of nod.pdf
3 10 Write a short JAVA method to count the number of nod.pdf
 

Dernier

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 

Dernier (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

3 a Consider the selfattention operation SX defined as.pdf

  • 1. 3. (a) Consider the self-attention operation S(X) defined as follows AS(X)t,:=1XWqWkTXT= softmax(At,:)XWv Where XRTDin,WvRDinDk,WkRDinDk,WqRDinDk.Din being the input dimensionality and T a sequence (or set) length (b) (15 points) Show that for any permutation matrix P,PS(X)=S(PX) (c) (5 points) We would like to use S(X) and a linear operation to construct a permutation invariant function G(X) that outputs the same feature representation for any ordering of the input sequence (hence, it is invariant to the input's arrangement). What linear operation can we use? Specifically find an example of a vector w such that G(X)=wTS(X) satisfies the condition G(X)=G(PX) for all permutation matrix P. (d) (15 points) Consider a batched ZRBTD that is for example the output of a self-attention layer. Implement a nn.module or python function using functionalize that takes Z and applies a "Position wise feedforward network" layer, H(x)=relu(W1x+ b) which outputs a tensor of size RBTD as commonly used in transformer models. Implement this in two ways (1) using nn. Linear and (2) using nn. Conv1d with padding 0 , stride 1 and kernel size 1 . Validate your implementations match with an assert statement. You may select a random Z with the size B,T,D of your choosing for validating your implementation.