Antik Khan
Add annotations
3d3ae36
Raw
History Blame Contribute Delete
2.37 kB
{
"task": {
"id": "case_41",
"name": "make_absolute",
"summary": "Make each element of the input sequence absolute.",
"examples": [
{
"input": [
"BOS",
7,
-2,
-9,
9,
4,
-4,
1,
-3,
4
],
"output": [
"BOS",
7,
2,
9,
9,
4,
4,
1,
3,
4
]
},
{
"input": [
"BOS",
-8,
-6,
8,
-4,
-2,
-4,
7,
-7,
3
],
"output": [
"BOS",
8,
6,
8,
4,
2,
4,
7,
7,
3
]
},
{
"input": [
"BOS",
-4,
9,
4,
0,
-3,
-4,
8,
0,
0
],
"output": [
"BOS",
4,
9,
4,
0,
3,
4,
8,
0,
0
]
},
{
"input": [
"BOS",
-7,
-3,
-8,
-9,
1,
-5,
-9,
-10,
1
],
"output": [
"BOS",
7,
3,
8,
9,
1,
5,
9,
10,
1
]
},
{
"input": [
"BOS",
1,
6,
-1,
5,
4,
4,
8,
1,
9
],
"output": [
"BOS",
1,
6,
1,
5,
4,
4,
8,
1,
9
]
}
],
"is_categorical": true
},
"program": "return rasp.Map(lambda x: x if x >= 0 else -x, rasp.tokens).named(\"make_absolute\")",
"components": [
{
"id": "L0_MLP",
"hook": "blocks.0.mlp.hook_post",
"role": {
"tag": "MAPPER",
"note": "Applies an element-wise absolute-value transform to each input number."
},
"rasp_vars": [
"make_absolute"
],
"labels": [
"make_absolute_1"
]
}
]
}