Ctrl + k

or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pyopencl@2025.2.x
tile.json

tessl/pypi-pyopencl

tessl install tessl/pypi-pyopencl@2025.2.0

Python wrapper for OpenCL enabling GPU and parallel computing with comprehensive array operations and mathematical functions

Agent Success

Agent success rate when using this tile

86%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.28x

Baseline

Agent success rate without this tile

67%

task.mdevals/scenario-5/

GPU-Accelerated Statistical Normalization

Build a module that performs statistical normalization operations on numerical datasets using GPU acceleration. The module should standardize data by computing z-scores and handle multiple normalization transformations efficiently on the GPU.

Capabilities

Z-Score Normalization

Compute standardized scores (z-scores) for a dataset where each element is transformed using the formula: (x - mean) / standard_deviation.

  • Given an array [1.0, 2.0, 3.0, 4.0, 5.0], compute z-scores. With mean=3.0 and std≈1.41, the result should be approximately [-1.41, -0.71, 0.0, 0.71, 1.41] @test
  • Computing z-scores for an array [0.0, 0.0, 0.0] returns [0.0, 0.0, 0.0] (when std is 0) @test

Min-Max Normalization

Scale values to a specific range by applying the transformation: (x - min) / (max - min) * (new_max - new_min) + new_min.

  • Given array [0.0, 50.0, 100.0], normalize to [0, 1]. Result: [0.0, 0.5, 1.0] @test
  • Given array [10.0, 15.0, 20.0], normalize to [-1, 1]. Result: [-1.0, 0.0, 1.0] @test

Combined Statistical Operations

Perform arithmetic operations combining multiple statistical measures.

  • Given arrays [10.0, 20.0, 30.0] and [5.0, 10.0, 15.0] with weights 0.7 and 0.3, result: [8.5, 17.0, 25.5] @test
  • Given array [1.0, 2.0, 3.0] with mean=2.0, squared deviations: [1.0, 0.0, 1.0] @test

Implementation

@generates

API

def zscore_normalize(data: list[float]) -> list[float]:
    """
    Compute z-scores for the input data.

    Z-score = (x - mean) / std_dev

    Parameters:
    - data: List of numerical values

    Returns:
    - List of z-score normalized values
    """

def minmax_normalize(data: list[float], new_min: float = 0.0, new_max: float = 1.0) -> list[float]:
    """
    Normalize data to specified range using min-max scaling.

    Formula: (x - old_min) / (old_max - old_min) * (new_max - new_min) + new_min

    Parameters:
    - data: List of numerical values
    - new_min: Minimum value of target range (default 0.0)
    - new_max: Maximum value of target range (default 1.0)

    Returns:
    - List of normalized values in range [new_min, new_max]
    """

def weighted_average(data1: list[float], data2: list[float], weight1: float, weight2: float) -> list[float]:
    """
    Compute element-wise weighted average of two arrays.

    Formula: weight1 * data1 + weight2 * data2

    Parameters:
    - data1: First array of values
    - data2: Second array of values (must be same length as data1)
    - weight1: Weight for first array
    - weight2: Weight for second array

    Returns:
    - List of weighted average values
    """

def squared_deviations(data: list[float]) -> list[float]:
    """
    Compute squared deviations from the mean.

    Formula: (x - mean)^2 for each element

    Parameters:
    - data: List of numerical values

    Returns:
    - List of squared deviations
    """

Dependencies { .dependencies }

pyopencl { .dependency }

Provides GPU-accelerated array operations and OpenCL context management for high-performance numerical computing.