Esempio n. 1
0
        public TensorModel ReadModel(List <string> _RawData)
        {
            TensorModel Model = new TensorModel();

            try
            {
                // Doc dong dau tien, tao lop InputLayer va set ten cho model
                var _stringtemp = _RawData[0].Split(new char[] { '(', ')' });
                Model.ModelName = _stringtemp[0].Replace("def", string.Empty);
                InputLayer _inputlayer;
                Model.Layers.Add(_inputlayer = new InputLayer(_stringtemp[1]));

                // Doc cac dong tiep theo la thu tu cac lop cua Model
                for (int i = 1; i < _RawData.Count; i++)
                {
                    Layer _layertemp = new Layer();
                    Model.Layers.Add(LayerReader(_RawData[i]));
                }
            }
            catch
            {
            }
            // Tra ve Tensorflow Model
            return(Model);
        }
Esempio n. 2
0
        public MainWindow()
        {
            InitializeComponent();
            this.Model = new TensorModel();

            MainScrollViewer.ScrollChanged              += OnScrollViewerScrollChanged;
            MainScrollViewer.MouseLeftButtonUp          += OnMouseLeftButtonUp;
            MainScrollViewer.PreviewMouseLeftButtonUp   += OnMouseLeftButtonUp;
            MainScrollViewer.PreviewMouseLeftButtonDown += OnMouseLeftButtonDown;
            MainScrollViewer.MouseMove  += OnMouseMove;
            this.Grid_ToolBox.Visibility = System.Windows.Visibility.Hidden;
            lbZoomRatio.Content          = "100%";
            StartupLogo.Fill             = new ImageBrush {
                ImageSource = new BitmapImage(new Uri(@"pack://application:,,,/TensorGram;component/Resources/Logo-01.png", UriKind.Absolute))
            };
        }
Esempio n. 3
0
        public TextInput_Hander(string textinput, ref TensorModel _ModelOutput)
        {
            try
            {
                // Get du lieu dau vao thanh tung dong, luu vao List RawTextData, dong thoi luoc bo nhung dong trong
                RawTextData = new List <string>();
                foreach (string myString in textinput.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
                {
                    // Luoc bo nhung khoang trong (space) trong tung dong
                    RawTextData.Add(myString.Replace(" ", string.Empty));
                }

                _ModelOutput = ReadModel(RawTextData);
            }
            catch
            {
                // Bat loi
            }
        }