Ejemplo n.º 1
0
        protected override string ProcessMessageAsLayerObject(Command msgObj, SyftController ctrl)
        {
            switch (msgObj.functionCall)
            {
            case "add":
            {
                // TODO: Handle adding layers better
                var input = (Layer)ctrl.GetModel(int.Parse(msgObj.tensorIndexParams[0]));
                Debug.LogFormat("<color=magenta>Layer Added to Sequential:</color> {0}", input.Id);
                this.AddLayer(input);
                return(input.Id + "");
            }

            case "models":
            {
                string out_str = "";

                for (int i = 0; i < this.layers.Count; i++)
                {
                    out_str += this.layers[i].ToString() + ",";
                }
                return(out_str);
            }

            case "config":
            {
                Debug.LogFormat("<color=magenta>Get Config:</color> ");

                var config = this.GetConfig();
                config["backend"] = "openmined";

                return(config.ToString(Formatting.None));
            }

            default:
            {
                return("Model.processMessage not Implemented:" + msgObj.functionCall);
            }
            }
        }