帮我分析下这个需求Step 1: You will be assigned a question that you need to answer and create a skeleton answer. If the skeleton answer meets the requirements described above after revising, you will get a full point on this task. Step 2: You need to draft a rubric for marking the question. If the rubric meets the requirements described above after revising, you will get a full point on this task. (Note: keep in mind that the better rubric you write, the better chance you have at getting similar marking from different TAs)
时间: 2024-04-26 22:23:06 浏览: 137
这个需求可以分为两个步骤:
第一步是回答一个问题并创建一个框架答案,然后进行修订,如果修订后的框架答案符合要求,就可以得到一个完整的分数。
第二步是起草一个用于评分的评分标准。如果修订后的评分标准符合要求,就可以得到一个完整的分数。需要注意的是,你写的评分标准越好,就越有可能得到不同TA的相似评分。
相关问题
Description Consider the following 5 picture frames placed on an 9 x 8 array. ........ ........ ........ ........ .CCC.... EEEEEE.. ........ ........ ..BBBB.. .C.C.... E....E.. DDDDDD.. ........ ..B..B.. .C.C.... E....E.. D....D.. ........ ..B..B.. .CCC.... E....E.. D....D.. ....AAAA ..B..B.. ........ E....E.. D....D.. ....A..A ..BBBB.. ........ E....E.. DDDDDD.. ....A..A ........ ........ E....E.. ........ ....AAAA ........ ........ EEEEEE.. ........ ........ ........ ........ 1 2 3 4 5 Now place them on top of one another starting with 1 at the bottom and ending up with 5 on top. If any part of a frame covers another it hides that part of the frame below. Viewing the stack of 5 frames we see the following. .CCC.... ECBCBB.. DCBCDB.. DCCC.B.. D.B.ABAA D.BBBB.A DDDDAD.A E...AAAA EEEEEE.. In what order are the frames stacked from bottom to top? The answer is EDABC. Your problem is to determine the order in which the frames are stacked from bottom to top given a picture of the stacked frames. Here are the rules: 1. The width of the frame is always exactly 1 character and the sides are never shorter than 3 characters. 2. It is possible to see at least one part of each of the four sides of a frame. A corner shows two sides. 3. The frames will be lettered with capital letters, and no two frames will be assigned the same letter. Input Each input block contains the height, h (h<=30) on the first line and the width w (w<=30) on the second. A picture of the stacked frames is then given as h strings with w characters each. Your input may contain multiple blocks of the format described above, without any blank lines in between. All blocks in the input must be processed sequentially. Output Write the solution to the standard output. Give the letters of the frames in the order they were stacked from bottom to top. If there are multiple possibilities for an ordering, list all such possibilities in alphabetical order, each one on a separate line. There will always be at least one legal ordering for each input block. List the output for all blocks in the input sequentially, without any blank lines (not even between blocks). Sample Input 9 8 .CCC.... ECBCBB.. DCBCDB.. DCCC.B.. D.B.ABAA D.BBBB.A DDDDAD.A E...AAAA EEEEEE.. Sample Output EDABC
这是一道经典的拓扑排序问题。我们可以将每个图形看作一个节点,如果一个图形可以覆盖另一个图形,那就从覆盖的图形指向被覆盖的图形。最后得到的图是一个 DAG,我们可以对其进行拓扑排序。拓扑排序的结果就是图形的叠放顺序。
代码实现可以使用邻接表存储 DAG,然后使用 Kahn 算法进行拓扑排序。对于存在多个拓扑序列的情况,我们可以使用字典序最小的方式输出所有的序列。
以下是 Python 代码实现:
Module wrapper that returns intermediate layers from a model It has a strong assumption that the modules have been registered into the model in the same order as they are used. This means that one should **not** reuse the same nn.Module twice in the forward if you want this to work. Additionally, it is only able to query submodules that are directly assigned to the model. So if `model` is passed, `model.feature1` can be returned, but not `model.feature1.layer2`. Arguments: model (nn.Module): model on which we will extract the features return_layers (Dict[name, new_name]): a dict containing the names of the modules for which the activations will be returned as the key of the dict, and the value of the dict is the name of the returned activation (which the user can specify).
这是一个模块包装器,可以从模型中返回中间层。它有一个强烈的假设,即模块已经以与它们在模型中使用的顺序相同的顺序注册到模型中。这意味着,如果你想让它起作用,就不应该在前向传递中两次重复使用相同的 nn.Module。此外,它只能查询直接分配给模型的子模块。因此,如果传递了“model”,则可以返回“model.feature1”,但不能返回“model.feature1.layer2”。参数包括模型本身和一个包含模块名称和返回激活的名称的字典。用户可以指定返回的激活的名称。
阅读全文