void Awake() { this.testbench = null; this.inputSelector = null; this.targetSelector = null; this.closeView = false; }
public void createTestbench() { Debug.Log("Creating Testbench"); dataset.setTargetAttribute(includeIndices[this.targetSelector.GetComponent <VariableSelector>().value - 1]); dataset.buildMatrix(); int numberOfInputs = this.inputSelector.GetComponent <VariableSelector>().value; if (numberOfInputs < dataset.includeIndices.Count) { dataset.reduceDimensions(numberOfInputs); } else { numberOfInputs = dataset.includeIndices.Count; } dataset.partitionDataset(this.partitionSlider.GetComponent <Slider>().value); List <int> hiddenLayerSizes = new List <int>(); foreach (GameObject selector in hiddenLayerSelectors) { hiddenLayerSizes.Add(selector.GetComponent <VariableSelector>().value); } this.testbench = new Testbench(dataset, hiddenLayerSizes, 0.1f); }
public void Initialize(Testbench testbench) { this.newTestbench = testbench; this.view = Instantiate(neuralNetworkViewPrefab, Vector3.zero, Quaternion.identity, this.transform); this.view.GetComponent <NeuralNetworkView>().setNeuralNetwork(testbench.network, "full"); List <string> inputNames = new List <string>(); List <string> activationFunctions = new List <string>(); if (testbench.dataset.singularValues != null) { inputNames = new List <string>(Functions.map((x => "Singular value: " + x.ToString()), testbench.dataset.singularValues.ToArray())); } else { inputNames = testbench.dataset.getInputNames(); } this.view.GetComponent <NeuralNetworkView>().setNeuronNames(inputNames, new List <string>(testbench.dataset.getTargetStringClasses())); this.view.GetComponent <NeuralNetworkView>().setNeuronActivationFunctions(testbench.network.getActivationFunctions()); this.trainingMenu = Instantiate(trainingMenuPrefab, Vector3.zero, Quaternion.identity, this.transform); this.trainingMenu.GetComponent <Canvas>().worldCamera = view.GetComponent <NeuralNetworkView>().camera; this.trainingMenu.GetComponent <Canvas>().renderMode = RenderMode.ScreenSpaceCamera; this.trainingMenu.GetComponent <Canvas>().planeDistance = 1.0f; }
public static void Run() { Testbench tb = new Testbench(); DesignContext.Instance.Elaborate(); ///remember start time Start = System.DateTime.Now.Ticks; DesignContext.Instance.Simulate(Cycles * Testbench.ClockCycle); #if RUNANALYSIS // Now convert the design to VHDL and embed it into a Xilinx ISE project XilinxProject project = new XilinxProject(@".\hdl_output", "Arbiter"); project.PutProperty(EXilinxProjectProperties.DeviceFamily, EDeviceFamily.Spartan3); project.PutProperty(EXilinxProjectProperties.Device, EDevice.xc3s1500l); project.PutProperty(EXilinxProjectProperties.Package, EPackage.fg676); project.PutProperty(EXilinxProjectProperties.SpeedGrade, ESpeedGrade._4); project.PutProperty(EXilinxProjectProperties.PreferredLanguage, EHDL.VHDL); VHDLGenerator codeGen = new VHDLGenerator(); SynthesisEngine.Create(DesignContext.Instance, project).Synthesize(codeGen); project.Save(); // Now convert the design to VHDL and embed it into a Xilinx ISE project XilinxProject project_SC = new XilinxProject(@".\SystemC_output", "SimpleCounter"); project_SC.PutProperty(EXilinxProjectProperties.DeviceFamily, EDeviceFamily.Spartan3); project_SC.PutProperty(EXilinxProjectProperties.Device, EDevice.xc3s1500l); project_SC.PutProperty(EXilinxProjectProperties.Package, EPackage.fg676); project_SC.PutProperty(EXilinxProjectProperties.SpeedGrade, ESpeedGrade._4); project_SC.PutProperty(EXilinxProjectProperties.PreferredLanguage, EHDL.VHDL); SystemCGenerator codeGen_SC = new SystemCGenerator(); SynthesisEngine.Create(DesignContext.Instance, project_SC).Synthesize(codeGen_SC); project_SC.Save(); #endif }