Antik Khan
Add annotations
3d3ae36
Raw
History Blame Contribute Delete
3.08 kB
{
"task": {
"id": "case_114",
"name": "logarithm_base10",
"summary": "Apply a logarithm base 10 to each element of the input sequence.",
"examples": [
{
"input": [
"BOS",
7,
4,
8,
5,
7,
10,
3,
7,
8
],
"output": [
"BOS",
0.8450980400142567,
0.6020599913279623,
0.9030899869919434,
0.6989700043360187,
0.8450980400142567,
1.0,
0.47712125471966244,
0.8450980400142567,
0.9030899869919434
]
},
{
"input": [
"BOS",
3,
7,
4,
9,
3,
5,
3,
7,
5
],
"output": [
"BOS",
0.47712125471966244,
0.8450980400142567,
0.6020599913279623,
0.9542425094393249,
0.47712125471966244,
0.6989700043360187,
0.47712125471966244,
0.8450980400142567,
0.6989700043360187
]
},
{
"input": [
"BOS",
6,
2,
5,
1,
10,
6,
9,
1,
10
],
"output": [
"BOS",
0.7781512503836435,
0.30102999566398114,
0.6989700043360187,
0.0,
1.0,
0.7781512503836435,
0.9542425094393249,
0.0,
1.0
]
},
{
"input": [
"BOS",
5,
4,
8,
8,
3,
6,
5,
2,
8
],
"output": [
"BOS",
0.6989700043360187,
0.6020599913279623,
0.9030899869919434,
0.9030899869919434,
0.47712125471966244,
0.7781512503836435,
0.6989700043360187,
0.30102999566398114,
0.9030899869919434
]
},
{
"input": [
"BOS",
9,
7,
2,
4,
9,
2,
10,
9,
10
],
"output": [
"BOS",
0.9542425094393249,
0.8450980400142567,
0.30102999566398114,
0.6020599913279623,
0.9542425094393249,
0.30102999566398114,
1.0,
0.9542425094393249,
1.0
]
}
],
"is_categorical": true
},
"program": "def apply_log(element):\n return math.log(element, 10)\n\nlogarithm = rasp.Map(apply_log, rasp.tokens).named(\"logarithm\")\nreturn logarithm",
"components": [
{
"id": "L0_MLP",
"hook": "blocks.0.mlp.hook_post",
"role": {
"tag": "MAPPER",
"note": "Applies a base-10 logarithm to each element independently."
},
"rasp_vars": [
"logarithm"
],
"labels": [
"logarithm_1"
]
}
]
}