module

MicroGPT::MathUtils

Instance methods

concat_cols(mats : Array(Mat)) : Mat
Source
softmax_backward(s : Mat, ds : Mat) : Mat
Source
softmax_rows(x : Mat) : Mat
Source
split_cols(m : Mat, sizes : Array(Int32)) : Array(Mat)
Source
stack_mats(mats : Array(Mat)) : Mat

Stack matrices vertically: [A(r×c), B(r×c), ...] → (n*r × c)

Source
unstack_mats(m : Mat, count : Int32, rows_per : Int32) : Array(Mat)

Unstack: (n*r × c) → n matrices of (r × c)

Source