%if "%{?tizen_feature_ml_support}" == "1" || "%{?unified_build}" == "1"
BuildRequires: pkgconfig(nnstreamer)
BuildRequires: pkgconfig(capi-ml-inference)
+BuildRequires: pkgconfig(nntrainer)
+BuildRequires: pkgconfig(ccapi-ml-training)
%endif
%if "%{?tizen_feature_badge_support}" == "1" || "%{?unified_build}" == "1"
'ml_tensors_info_manager.h',
'ml_single_manager.cc',
'ml_single_manager.h',
+ 'ml_trainer_manager.cc',
+ 'ml_trainer_manager.h',
'ml_singleshot.cc',
'ml_singleshot.h',
+ 'ml_trainer.cc',
+ 'ml_trainer.h',
'ml_utils.cc',
'ml_utils.h',
],
'packages': [
'nnstreamer',
'capi-ml-inference',
+ 'nntrainer',
+ 'ccapi-ml-training',
]
},
}],
//= require('ml_common.js');
//= require('ml_single.js');
//= require('ml_pipeline.js');
+//= require('ml_trainer.js');
//= require('ml_manager.js');
ReportSuccess(picojson::value{open}, out);
}
+void MlInstance::MLTrainerLayerSetProperty(const picojson::value& args, picojson::object& out) {
+}
+void MlInstance::MLTrainerLayerCreate(const picojson::value& args, picojson::object& out) {
+}
+
+void MlInstance::MLTrainerOptimizerSetProperty(const picojson::value& args, picojson::object& out) {
+}
+void MlInstance::MLTrainerOptimizerCreate(const picojson::value& args, picojson::object& out) {
+}
+
+void MlInstance::MLTrainerModelConstruct(const picojson::value& args, picojson::object& out) {
+}
+void MlInstance::MLTrainerModelCompile(const picojson::value& args, picojson::object& out) {
+}
+void MlInstance::MLTrainerModelAddLayer(const picojson::value& args, picojson::object& out) {
+}
+void MlInstance::MLTrainerModelRun(const picojson::value& args, picojson::object& out) {
+}
+void MlInstance::MLTrainerModelSummarize(const picojson::value& args, picojson::object& out) {
+}
+void MlInstance::MLTrainerModelSetDataset(const picojson::value& args, picojson::object& out) {
+}
+void MlInstance::MLTrainerModelSetOptimizer(const picojson::value& args, picojson::object& out) {
+}
+void MlInstance::MLTrainerCreateGeneratorDataset(const picojson::value& args,
+ picojson::object& out) {
+}
+void MlInstance::MLTrainerCreateFileDataset(const picojson::value& args, picojson::object& out) {
+}
+
#undef CHECK_EXIST
#undef CHECK_TYPE
#undef CHECK_TYPE_X
#include "ml/ml_pipeline_manager.h"
#include "ml/ml_single_manager.h"
+#include "ml/ml_trainer_manager.h"
#include "nnstreamer/nnstreamer-single.h"
#include "nnstreamer/nnstreamer.h"
void MLPipelineValveSetOpen(const picojson::value& args, picojson::object& out);
void MLPipelineValveIsOpen(const picojson::value& args, picojson::object& out);
+
+ Trainer trainer_manager_;
+
+ void MLTrainerLayerSetProperty(const picojson::value& args, picojson::object& out);
+ void MLTrainerLayerCreate(const picojson::value& args, picojson::object& out);
+
+ void MLTrainerOptimizerSetProperty(const picojson::value& args, picojson::object& out);
+ void MLTrainerOptimizerCreate(const picojson::value& args, picojson::object& out);
+
+ void MLTrainerModelConstruct(const picojson::value& args, picojson::object& out);
+ void MLTrainerModelCompile(const picojson::value& args, picojson::object& out);
+ void MLTrainerModelAddLayer(const picojson::value& args, picojson::object& out);
+ void MLTrainerModelRun(const picojson::value& args, picojson::object& out);
+ void MLTrainerModelSummarize(const picojson::value& args, picojson::object& out);
+ void MLTrainerModelSetDataset(const picojson::value& args, picojson::object& out);
+ void MLTrainerModelSetOptimizer(const picojson::value& args, picojson::object& out);
+ void MLTrainerCreateGeneratorDataset(const picojson::value& args, picojson::object& out);
+ void MLTrainerCreateFileDataset(const picojson::value& args, picojson::object& out);
};
} // namespace ml
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ml_trainer_manager.h"
+
+#include "common/tools.h"
+#include "nntrainer/model.h"
+
+using common::ErrorCode;
+using common::PlatformResult;
+
+namespace train = ml::train;
+
+namespace extension {
+namespace ml {
+
+TrainerManager::TrainerManager() {
+ ScopeLogger();
+}
+
+TrainerManager::~TrainerManager() {
+ ScopeLogger();
+}
+
+
+} // namespace ml
+} // namespace extension
--- /dev/null
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ML_ML_TRAINER_MANAGER_H_
+#define ML_ML_TRAINER_MANAGER_H_
+
+#include <mutex>
+
+#include "common/platform_result.h"
+#include "ml_trainer.h"
+
+#include <nntrainer/model.h>
+
+using common::PlatformResult;
+
+namespace train = ml::train;
+
+namespace extension {
+namespace ml {
+
+class TrainerManager {
+ public:
+ TrainerManager();
+ ~TrainerManager();
+
+ TrainerManager(const TrainerManager&) = delete;
+ TrainerManager& operator=(const TrainerManager&) = delete;
+
+ private:
+ int next_model_id_ = 0;
+ int next_layer_id_ = 0;
+ int next_optimizer_id_ = 0;
+ int next_dataset_id_ = 0;
+ std::map<int, std::unique_ptr<train::Model>> models_;
+ std::mutex trainers_mutex_;
+};
+
+} // namespace ml
+} // namespace extension
+
+#endif // ML_ML_TRAINER_MANAGER_H_