Ejemplo n.º 1
0
        public void Load(string name)
        {
            TextAsset        text           = Resources.Load <TextAsset>("Model/" + name);
            NNModelSerialize modelSerialize = JsonUtility.FromJson <NNModelSerialize>(text.text);

            Layers = new List <NNLayerBase>();
            for (int i = 0; i < modelSerialize.LayerJson.Count; i++)
            {
                var nnlayer = JsonUtility.FromJson(modelSerialize.LayerJson[i], Type.GetType(modelSerialize.LayerTypes[i])) as NNLayerBase;
                nnlayer.FromCache();
                Layers.Add(nnlayer);
                if (i == 0)
                {
                    Input = nnlayer as InputLayer;
                }
            }
            Output = new OutputLayer();
            //Debug = new DebugLayer();
        }