Map<String, dynamic> toJson() { return { "weights": weights.toJson(), "bias": bias.toJson(), "activation": activationFunc.type.toString() }; }