Loading c_binding/ml_c_embedder.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,18 @@ ml_model mlce_init_keras(const char *filename) { return reinterpret_cast<ml_model> (new ml_embedder::keras(std::string(filename))); } //------------------------------------------------------------------------------ /// @brief Initalize a custom pytorch model. /// /// @param[in] weights_filename Path to the model weights. /// @param[in] config_filename Path to the model config. //------------------------------------------------------------------------------ ml_model mlce_init_custom_pytorch(const char *weights_filename, const char *config_filename) { return reinterpret_cast<ml_model> (new ml_embedder::custom_pytorch(std::string(weights_filename), std::string(config_filename))); } //------------------------------------------------------------------------------ /// @brief Finalize a model. /// Loading c_binding/ml_c_embedder.h +9 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,15 @@ extern "C" { //------------------------------------------------------------------------------ ml_model mlce_init_keras(const char *filename); //------------------------------------------------------------------------------ /// @brief Initalize a custom pytorch model. /// /// @param[in] weights_filename Path to the model weights. /// @param[in] config_filename Path to the model config. //------------------------------------------------------------------------------ ml_model mlce_init_custom_pytorch(const char *weights_filename, const char *config_filename); //------------------------------------------------------------------------------ /// @brief Finalize a model. /// Loading example_models/saved_model.keras→example_models/EPED/saved_model.keras (37.2 KiB) File moved. View file example_models/TGLF/MyModel_manual.json 0 → 100644 +77 −0 Original line number Diff line number Diff line { "model_name": "MyModel", "layers": [ { "name": "dense1", "class_name": "Dense", "units": 15, "activation": "relu", "use_bias": true }, { "name": "dense2", "class_name": "Dense", "units": 25, "activation": "relu", "use_bias": true }, { "name": "dense3", "class_name": "Dense", "units": 15, "activation": "relu", "use_bias": true }, { "name": "dense4", "class_name": "Dense", "units": 1, "activation": "softplus", "use_bias": true } ], "weights": { "dense1": { "kernel": null, "bias": null }, "dense2": { "kernel": null, "bias": null }, "dense3": { "kernel": null, "bias": null }, "dense4": { "kernel": null, "bias": null } }, "forward_logic": [ { "operation": "slice", "axis": 1, "start": 0, "end": -1, "input": "inputs", "output": "x" }, { "operation": "dense_layers", "sequence": [ "dense1", "dense2", "dense3", "dense4" ], "input": "x", "output": "x" }, { "operation": "scale", "formula": "x / (1/39 / inputs[:, -1])", "output": "x" } ] } No newline at end of file example_models/TGLF/keras_model_weights.weights.h5 0 → 100644 +20.5 KiB File added.No diff preview for this file type. View file Loading
c_binding/ml_c_embedder.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,18 @@ ml_model mlce_init_keras(const char *filename) { return reinterpret_cast<ml_model> (new ml_embedder::keras(std::string(filename))); } //------------------------------------------------------------------------------ /// @brief Initalize a custom pytorch model. /// /// @param[in] weights_filename Path to the model weights. /// @param[in] config_filename Path to the model config. //------------------------------------------------------------------------------ ml_model mlce_init_custom_pytorch(const char *weights_filename, const char *config_filename) { return reinterpret_cast<ml_model> (new ml_embedder::custom_pytorch(std::string(weights_filename), std::string(config_filename))); } //------------------------------------------------------------------------------ /// @brief Finalize a model. /// Loading
c_binding/ml_c_embedder.h +9 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,15 @@ extern "C" { //------------------------------------------------------------------------------ ml_model mlce_init_keras(const char *filename); //------------------------------------------------------------------------------ /// @brief Initalize a custom pytorch model. /// /// @param[in] weights_filename Path to the model weights. /// @param[in] config_filename Path to the model config. //------------------------------------------------------------------------------ ml_model mlce_init_custom_pytorch(const char *weights_filename, const char *config_filename); //------------------------------------------------------------------------------ /// @brief Finalize a model. /// Loading
example_models/saved_model.keras→example_models/EPED/saved_model.keras (37.2 KiB) File moved. View file
example_models/TGLF/MyModel_manual.json 0 → 100644 +77 −0 Original line number Diff line number Diff line { "model_name": "MyModel", "layers": [ { "name": "dense1", "class_name": "Dense", "units": 15, "activation": "relu", "use_bias": true }, { "name": "dense2", "class_name": "Dense", "units": 25, "activation": "relu", "use_bias": true }, { "name": "dense3", "class_name": "Dense", "units": 15, "activation": "relu", "use_bias": true }, { "name": "dense4", "class_name": "Dense", "units": 1, "activation": "softplus", "use_bias": true } ], "weights": { "dense1": { "kernel": null, "bias": null }, "dense2": { "kernel": null, "bias": null }, "dense3": { "kernel": null, "bias": null }, "dense4": { "kernel": null, "bias": null } }, "forward_logic": [ { "operation": "slice", "axis": 1, "start": 0, "end": -1, "input": "inputs", "output": "x" }, { "operation": "dense_layers", "sequence": [ "dense1", "dense2", "dense3", "dense4" ], "input": "x", "output": "x" }, { "operation": "scale", "formula": "x / (1/39 / inputs[:, -1])", "output": "x" } ] } No newline at end of file
example_models/TGLF/keras_model_weights.weights.h5 0 → 100644 +20.5 KiB File added.No diff preview for this file type. View file