k-microgrid-patchtsmixer-pilot

A small experimental model for 15-slot microgrid power-target regression. It combines the Transformers PatchTSMixer backbone with a custom regression head and includes CPU inference code, a synthetic input example, training details, and evaluation results.

Model ID: psyrenpark/k-microgrid-patchtsmixer-pilot

Publisher: Psyren Park 路 GitHub 路 Blog

Model overview

Item Details
Architecture PatchTSMixer backbone with a custom regression head
Input 4 chronological observations with 290 features each
Observation interval 900 seconds (15 minutes)
Output 65 targets with their physical units
Input contract gh_15slot_15min_v1
Training From scratch, 40 scenarios split into 28 train / 6 validation / 6 test, 1 epoch
Inference CPU, FP32, single thread, local files only

CPU usage

With Python 3.11 and the dependencies listed in requirements.txt available, run the following command from the package directory:

python infer.py --input example_input.json

Inference requires config.json, model.py, infer.py, model.safetensors, and manifest.json. No external model is downloaded during inference.

The result is a JSON object containing contract_id, target_order, units, network, normalized, and physical. The physical field contains 65 predictions in physical units, ordered by target_order. Units and scales are defined in config.json.

Inputs and outputs

The input JSON must include contract_id, the exact feature_order, and a finite-valued input[4][290] array. Inputs must use the same capacity-normalized feature space as the training data. Raw equipment values in kW or KRW require the corresponding feature transformation before being supplied to this package.

The loader applies (x - x_mean) / x_scale and clips the result to [-10, 10]. Feature names, order, and preprocessing values follow config.json. Inputs with an incorrect contract, feature order, shape, or NaN/Inf values are rejected.

network contains regression-head outputs in the training space. normalized contains outputs after the signed-expm1 inverse transform. physical multiplies those normalized outputs by the target-specific scales.

example_input.json is synthetic. It does not represent a real scenario or ground truth, and its predictions must not be used to assess model accuracy.

Training and evaluation

The model was trained from scratch for 1 epoch. It is neither a full-dataset training result nor a continuation of the original full-training checkpoint.

Split Scenarios Input samples
Train 28 2,688
Validation 6 576
Test 6 576

The following results use 6 test scenarios and 576 test samples. The baseline predicts the training-set mean.

Metric Value
Model normalized MAE 0.298604
Model normalized RMSE 0.375961
Mean-prediction baseline normalized MAE 0.239194

The model has a higher MAE than the baseline. No improvement in predictive performance, generalization, or real-world effectiveness is claimed. Per-target MAE/RMSE in physical units and baseline results are provided in metrics.csv.

Validation and limitations

Using single-threaded CPU FP32 inference, package outputs were compared with the original checkpoint for three synthetic inputs: zeros, signed ramp, and clipping. The maximum absolute error was 0 for network, normalized, and physical, using rtol=1e-6 and atol=1e-7.

Validation covers package loading, the input/output contract, transformations, and output parity. Small-scale training and synthetic-input checks do not establish accuracy or safety on real equipment. Do not use this model for operational control decisions.

Attribution and license

Copyright 2026 Psyren Park.

The code and model weights are licensed under Apache-2.0. See LICENSE for the license text and NOTICE for third-party sources, copyrights, license terms, and modification notices.

This package reuses the PatchTSMixer architecture. The custom regression head, transformations, and experimental packaging are distinct contributions. Weights were trained from scratch and are not redistributed upstream pretrained weights. Original training data and optimizer state are not included.

Training details, source-identification hashes, and the validation environment are recorded in provenance.json. Package file SHA-256 hashes are listed in manifest.json.

Downloads last month
35
Safetensors
Model size
2.75M params
Tensor type
F32
路
Inference Providers NEW
This model isn't deployed by any Inference Provider. 馃檵 Ask for provider support