public CSharpOrNotWindow() { this.InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif this.codeDisplay = this.Get <TextBox>("CodeDisplay"); this.codeDisplay.PropertyChanged += this.CodeDisplayOnPropertyChanged; this.codeWindow = this.Get <TextBlock>("CodeWindow"); this.language = this.Get <TextBlock>("Language"); this.languageBox = this.Get <ContentControl>("LanguageBox"); this.codeImage = this.Get <Image>("CodeImage"); this.openFileButton = this.Get <Button>("OpenFileButton"); BitmapTools.SetGreyscalePalette(this.renderTarget); BitmapTools.SetGreyscalePalette(this.output); GradientSetup.EnsureInitialized(); this.model = CreateModel(classCount: IncludeExtensions.Length); this.model.build(new TensorShape(null, CSharpOrNot.Height, CSharpOrNot.Width, 1)); this.LoadWeights(); }
static void Main() { GradientEngine.UseEnvironmentFromVariable(); GradientSetup.EnsureInitialized(); var sample = new DigitRecognitionCNN(); sample.Run(); }
static int Main(string[] args) { GradientLog.OutputWriter = Console.Out; GradientSetup.UseEnvironmentFromVariable(); // required before using PythonEngine GradientSetup.EnsureInitialized(); np = PythonEngine.ImportModule("numpy"); return(ConsoleCommandDispatcher.DispatchCommand( ConsoleCommandDispatcher.FindCommandsInSameAssemblyAs(typeof(LinearSvmProgram)), args, Console.Out)); }