Exemplo n.º 1
0
        //[Fact]
        public void MiniEndToEnd()
        {
            // Building the graph
            var g       = new FGraph();
            var input   = g.New("input").AsInput().As2D(32, 32);
            var label   = g.New("label").AsInput().As1D(10);
            var hidden1 = g.Do(Layers.Dense(), input).As1D(128);
            var hidden2 = g.Do(Layers.Dense(), hidden1).As1D(128);
            var res     = g.Do(Layers.Dense(), hidden2).As("res").As1D(10);
            var err     = g.Do(Layers.SquareError(), input, label).AsCriterion();

            var graph = g.Build();

            // Geometric inference
            var solver = new GeometricSolver();

            solver.Solve(graph);

            // Optimizing the flow
            var optimizer = new AdamOptimizer(new MyTileCompiler(), new MyTensorAllocator());
            var reader    = new MyImageReader(/* dummy */ null);
            var flow      = optimizer.Optimize(graph, reader);

            // Evaluating with the flow
            var writer = new MyDigitReader(/* dummy */ 0);

            flow.Evaluate(reader, writer);
        }
Exemplo n.º 2
0
        public async Task <FGraph> GetGraph(string flowHandler)
        {
            var graph = new FGraph();

            var flow = await ResolveUiFlowFromHandler(flowHandler);

            var flowCluster = await BuildFlow(flow);

            flowCluster = await AddContainerStep(flow, flowCluster);

            graph.AddCluster(flowCluster);

            return(graph);
        }
Exemplo n.º 3
0
        protected override void OnInitUI()
        {
            t1 = GetChild <FRichText>("t1");
            t2 = GetChild <FRichText>("t2");
            t3 = GetChild <FTextInput>("t3");
            t4 = GetChild <FTextInput>("t4");
            t6 = GetChild <FRichText>("t6");
            n7 = GetChild <FGraph>("n7");

            t4.OnChanged((context) =>
            {
                t3.SetText(t4.GetText());
            });

            n7.OnClick((context) =>
            {
                System.Random random = new System.Random();
                t6.SetVar("num", random.Next(1, 100).ToString());
            });
        }
Exemplo n.º 4
0
 public static void createForceGraph()
 {
     g = new FGraph();
 }
Exemplo n.º 5
0
        private void ShowFormula(string cellRef, string formula)
        {
            var formulaObject = new ExcelFormulaParser.ExcelFormula(formula);
            System.Action action = () =>
            {
                this.Graph = new FGraph();
                var rootItem = new FVertex() { Name = cellRef };
                Graph.AddVertex(rootItem);
                ShowFormula(new Queue<ExcelFormulaToken>(formulaObject), rootItem);
                graphLayout.Graph = this.Graph;
            };

            Dispatcher.BeginInvoke(action);
        }
Exemplo n.º 6
0
 public static void createForceGraph()
 {
     g = new FGraph();
 }