Question: twodigit / train _ utils.py in this problom In your projoct foldor, look as the part 2 - twodigit subtoldcr. Thcre you can find the
twodigittrainutils.py in this problom
In your projoct foldor, look as the parttwodigit subtoldcr. Thcre you can find the filcs
mip.py and
conv.py
Your main task hore is to complcse the code irside the method sain in these files
Do the folowing stcps:
Look at maLn method in coch file Idcontify the training and test data and labcle. How many images are inside
the train and test data? What is the sizc of cach imagc?
Look at the defirition of the MLP clacs in
mip.py Try to make scrac of what thoac lines are trying in
achicve. What is ytraina and ytrain
Look at train
utils.py particularly the run epoch function.
Now ghen the intuition you have bult wi:h the above stopa, complete the following tasks.
Fully connected network
points puasale fungrietual
This problom is nequincd but ungraded bccouse it taloes a lot of ncsources from the graders. Honcec plewse try
your best, subvit your code but do nat wovy if the grador docs not refum, and refor to the solutians after due
datc.
Complete the code main in
mip.py to buid a fulyconnocted model with a single hidden Izycr with E units.
For this, you nood to malos use of Linear loyora in PyTorch; Unifes in the provious singledigt case, hore you
nood in use two scparatc Incar output Isyers, in generate the two outputs corresponding to the first and
sccond digits
Notc that we have prowided you with an implementation of rlatten which maps a higher dimensional terant
into an N xd onc, where N is the rumbcr of ssmplcs in your batch and is the length of the flattonod
dimension of your tensor is the flattencd dmenaion is
Available Functions: Yau heve access to the tarchm modulc as mn to the tarchmtunctianal as
and to the rlatten layce as rlatten ; No nocd to import arything.a inport torct
inpart torct an an ct
A partracataaL a
batatsiae b
ro claccos e
Prcss ESC then TAB or click outside of the code cditcr to exdt.
Incarract
Test resultsTraceback most recent cala Lant: tren part twadigattrain utadx inport latckity data, rn opoch, train madeL, flatter
NaduleMat TrurdZrrar: Na madule named 'part twaddRat'
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
