peal.architectures.onnx_predictor.write_final_linear¶
- peal.architectures.onnx_predictor.write_final_linear(src, dst, info, weight, bias)[source]¶
Replace the final layer’s weights for the selected classes.
- Parameters:
src (
str) – Source and destination.onnxfiles.dst (
str) – Source and destination.onnxfiles.info (
dict) –find_final_linear()ofsrc.weight (
array-like,shape (k,n_features)) – New weight rows, one per selected class (info["selected"], or all classes when nothing is selected), in output order.bias (
array-like,shape (k,)) – New biases. A MatMul without bias gets anAddwith a new bias initializer (zero for the classes that are not replaced).
- Returns:
dst.- Return type: