exam questions

Exam DP-100 All Questions

View all questions & answers for the DP-100 exam

Exam DP-100 topic 6 question 2 discussion

Actual exam question from Microsoft's DP-100
Question #: 2
Topic #: 7
[All DP-100 Questions]

HOTSPOT -
You need to use the Python language to build a sampling strategy for the global penalty detection models.
How should you complete the code segment? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: import pytorch as deeplearninglib
Box 2: ..DistributedSampler(Sampler)..
DistributedSampler(Sampler):
Sampler that restricts data loading to a subset of the dataset.
It is especially useful in conjunction with class:`torch.nn.parallel.DistributedDataParallel`. In such case, each process can pass a DistributedSampler instance as a
DataLoader sampler, and load a subset of the original dataset that is exclusive to it.
Scenario: Sampling must guarantee mutual and collective exclusively between local and global segmentation models that share the same features.
Box 3: optimizer = deeplearninglib.train. GradientDescentOptimizer(learning_rate=0.10)
Incorrect Answers: ..SGD..
Scenario: All penalty detection models show inference phases using a Stochastic Gradient Descent (SGD) are running too slow.
Box 4: .. nn.parallel.DistributedDataParallel..
DistributedSampler(Sampler): The sampler that restricts data loading to a subset of the dataset.
It is especially useful in conjunction with :class:`torch.nn.parallel.DistributedDataParallel`.
Reference:
https://github.com/pytorch/pytorch/blob/master/torch/utils/data/distributed.py

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
prashantjoge
Highly Voted 2 years, 11 months ago
TF supports static computational graph while pytorch supports dynamic Computational Graph. So the answer to the first question is pytorch since we are asked to use dynamic runtime graph computation the 2nd and 4th option are as described in the given solution The 3rd option is confusing, since SGD is offered by pytorch and gradient descent optimizer is offered by tensorflow. I will go with SGD, because it goes with the rest of the answers even though there is this "All penalty detection models show inference phases using a Stochastic Gradient Descent (SGD) are running too slow"
upvoted 12 times
...
dzzz
Highly Voted 3 years, 4 months ago
Box3: train.GradientDescentOptimizer belongs to TensorFlow, but the other boxes use Pytorch. https://www.tensorflow.org/api_docs/python/tf/compat/v1/train/GradientDescentOptimizer
upvoted 7 times
...
phdykd
Most Recent 9 months ago
-import pytorch as deeplearninglib f-train sampler = deeplearninglib.WeightedRandomSampler.(penalty video dataset) h-optimizer = deeplearninglib.optim. SGD(model. parameters).Ir=0,01) k-model = deeplearninglib.nn.parallel. DistributedDataParallelCPU(model) These options support the requirements of dynamic runtime graph computation, handling imbalance in the penalty detection classes, applying Stochastic Gradient Descent (SGD) optimizer, and employing parallel computations for the model respectively.
upvoted 1 times
...
phdykd
1 year, 2 months ago
Box 1: A) import pytorch as deeplearninglib Explanation: Since the feature mentioned, dynamic runtime graph computation, is a feature of PyTorch, we should import PyTorch in this case. Box 2: C) train_sampler= deeplearninglib.WeightedRnadomSampler.(penalty_video_dataset) Explanation: A sampling strategy is required for the global penalty detection models. The WeightedRandomSampler allows for weighted sampling, which may be useful for ensuring that rarer samples are not overlooked in the training process. Box 3: A) optimizer= deeplearninglib.optim.SGD(model.parameters().lr=0.01) Explanation: The SGD optimizer is mentioned specifically for the penalty detection models, and the learning rate is set to 0.01. Box 4: A) model= deeplearninglib.parallel.DistributedDataParallel(model) Explanation: The DistributedDataParallel module allows for parallel processing of a single model across multiple devices or nodes, which can significantly speed up the training process. This is useful for the global penalty detection models, which are mentioned to have slow inference times.
upvoted 1 times
...
ning
1 year, 10 months ago
No clue, the only thing I know of is that DistributedSampler, Optim.SGD, and nn.Parallel ... are all pytouch packages or classes ...
upvoted 1 times
...
[Removed]
2 years ago
is this question really for DP-100?? seems like it is for AI-102
upvoted 4 times
...
frida321
2 years, 7 months ago
so hard to answer
upvoted 5 times
...
ckkobe24
2 years, 7 months ago
its all messed up ......
upvoted 3 times
...
YipingRuan
2 years, 9 months ago
Why Box 4 uses CPU?
upvoted 1 times
...
andre999
2 years, 10 months ago
Box 2 is not correct either, it says 'deeplearming' instead of 'deeplearning'...
upvoted 1 times
...
luca2712
3 years, 3 months ago
I think, box3: optimizer = deeplearninglib.optim.SGD(model.parameters().lr=0,01) https://analyticsindiamag.com/how-ml-frameworks-like-tensorflow-and-pytorch-handle-gradient-descent/
upvoted 3 times
wjrmffldrhrl
3 years, 1 month ago
In this case say "All penalty detection models show inference phases using a Stochastic Gradient Descent (SGD) are running too slow."
upvoted 1 times
...
...
lucho94
3 years, 3 months ago
Which is the correct one?
upvoted 1 times
...
wahaha
3 years, 4 months ago
why pytorch not tensorflow? they both support Python
upvoted 1 times
kurasaki
3 years, 4 months ago
we need to use dynamic runtime graph computation thus pytorch
upvoted 8 times
...
sim39
2 years, 7 months ago
I might be wrong, but I think the "to.device()" code reveals that it must be PyTorch
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago