From 1d89bde513583d9c28c4d6b7516265eb7fc633d1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-S0O2C44\\ROG" Date: Sun, 20 Mar 2022 15:32:02 +0100 Subject: GetLatestModels FIX #41 --- backend/api/api/Models/Model.cs | 2 ++ backend/api/api/Services/IModelService.cs | 1 + backend/api/api/Services/ModelService.cs | 10 ++++++++++ 3 files changed, 13 insertions(+) (limited to 'backend') diff --git a/backend/api/api/Models/Model.cs b/backend/api/api/Models/Model.cs index 7c884ae9..5678daaf 100644 --- a/backend/api/api/Models/Model.cs +++ b/backend/api/api/Models/Model.cs @@ -36,6 +36,8 @@ namespace api.Models public int hiddenLayerNeurons { get; set; } public int hiddenLayers { get; set; } public int batchSize { get; set; } + // na izlazu je moguce da bude vise neurona (klasifikacioni problem sa vise od 2 klase) + public int outputNeurons { get; set; } public string inputLayerActivationFunction { get; set; } public string hiddenLayerActivationFunction { get; set; } public string outputLayerActivationFunction { get; set; } diff --git a/backend/api/api/Services/IModelService.cs b/backend/api/api/Services/IModelService.cs index 887be4ae..ee5c279f 100644 --- a/backend/api/api/Services/IModelService.cs +++ b/backend/api/api/Services/IModelService.cs @@ -7,6 +7,7 @@ namespace api.Services { Model GetOneModel(string username, string name); List GetMyModels(string username); + List GetLatestModels(string username); //List GetPublicModels(); Model Create(Model model); void Update(string username, string name, Model model); diff --git a/backend/api/api/Services/ModelService.cs b/backend/api/api/Services/ModelService.cs index 3d5c3b3e..f42219f5 100644 --- a/backend/api/api/Services/ModelService.cs +++ b/backend/api/api/Services/ModelService.cs @@ -30,6 +30,15 @@ namespace api.Services { return _model.Find(model => model.username == username).ToList(); } + public List GetLatestModels(string username) + { + List list = _model.Find(model => model.username == username).ToList(); + + list = list.OrderByDescending(model => model.lastUpdated).ToList(); + + return list; + } + /* public List GetPublicModels() { @@ -56,6 +65,7 @@ namespace api.Services return true; return false; } + } } -- cgit v1.2.3