//[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); }
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); }
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()); }); }
public static void createForceGraph() { g = new FGraph(); }
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); }
public static void createForceGraph() { g = new FGraph(); }