private void Update(EvaluationContext context) { var source = InputSize.GetValue(context); var factor = Factor.GetValue(context); Result.Value = new Size2((int)(source.Width * factor), (int)(source.Height * factor)); }
//可供搜索的下拉列表框 //Add By zhengsong //Time:2014-09-19 public static MvcHtmlString DropDownListControlFor <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, IEnumerable <SelectListItem> selectList, IDictionary <string, object> htmlAttributes = null, InputSize size = InputSize.Default) { string strSize = "select_middle "; if (size == InputSize.Long) { strSize = "select_long "; } else if (size == InputSize.Short) { strSize = "select_short "; } var tmpHtmlAttribute = new Dictionary <string, object> { { "class", string.Concat("select ", strSize, "chzn-select ") } }; tmpHtmlAttribute.Union(htmlAttributes); return(htmlHelper.DropDownListFor(expression, selectList, tmpHtmlAttribute)); }
public BootstrapTextBoxModel() { htmlAttributes = new Dictionary<string, object>(); size = InputSize._NotSet; appendButtons = new List<BootstrapButton>(); prependButtons = new List<BootstrapButton>(); }
public static string GetClassForInputSize(InputSize textBoxSize) { if (textBoxSize == InputSize.Mini) { return("input-mini"); } if (textBoxSize == InputSize.BlockLevel) { return("input-block-level"); } if (textBoxSize == InputSize.Small) { return("input-small"); } if (textBoxSize == InputSize.Medium) { return("input-medium"); } if (textBoxSize == InputSize.Large) { return("input-large"); } if (textBoxSize == InputSize.XLarge) { return("input-xlarge"); } if (textBoxSize == InputSize.XXLarge) { return("input-xxlarge"); } return(string.Empty); }
/// <summary> /// Writes this layer as XML /// </summary> /// <param name="writer">The XML writer</param> public void WriteTo(XmlWriter writer) { writer.WriteStartElement("layer"); writer.WriteAttributeString("input-size", InputSize.ToString()); writer.WriteAttributeString("output-size", OutputSize.ToString()); writer.WriteAttributeString("activation", Activation.ToString()); writer.WriteAttributeString("weight-init", WeightInitialisation.ToString()); writer.WriteAttributeString("regularisation", Regularisation.ToString()); writer.WriteAttributeString("weight-update", WeightUpdate.ToString()); writer.WriteAttributeString("trainer", LayerTrainer.ToString()); writer.WriteAttributeString("lambda", Lambda.ToString()); writer.WriteAttributeString("momentum", Momentum.ToString()); writer.WriteAttributeString("decay-rate", DecayRate.ToString()); writer.WriteAttributeString("decay-rate2", DecayRate2.ToString()); writer.WriteAttributeString("dropout", Dropout.ToString()); if (Bias != null) { Bias.WriteTo("bias", writer); } if (Weight != null) { writer.WriteStartElement("weight"); foreach (var item in Weight) { item.WriteTo("row", writer); } writer.WriteEndElement(); } writer.WriteEndElement(); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) // Выбор пункта меню { InputLabel.Visible = false; if (comboBox1.SelectedItem.ToString() == "Ввод из файла") { // Очистка формы Remove_Visual_Matrix(); Remove_Component_Label(); SizeChoice.Visible = false; InputSize.Visible = false; InputLabel.Visible = false; Convert_From_File(); // Считывание из файла } else if (comboBox1.SelectedItem.ToString() == "Ввод вручную") { //Очистка формы Remove_Visual_Matrix(); Remove_Component_Label(); SizeChoice.Visible = true; InputSize.Visible = true; InputSize.Focus(); // Ввод размера матрицы } else if (comboBox1.SelectedItem.ToString() == "Генерация данных") { TestGenerator.Generate_Tests(); // Генерация тестов MessageBox.Show("Файлы входных данных сгенерированы", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public override string ToString() { return(string.Format(CultureInfo.CurrentCulture, "VIDEO_STREAM_CONFIG_CAPS - guid: {0}, VideoStandard: {1}, " + "InputSize: {2}, " + "MinCroppingSize: {3}, MaxCroppingSize: {4}, " + "CropGranularityX: {5}, CropGranularityY: {6}, " + "CropAlignX: {7}, CropAlignY: {8}, " + "MinOutputSize: {9}, MaxOutputSize: {10}, " + "OutputGranularityX: {11}, OutputGranularityY: {12}, " + "StretchTapsX: {13}, StretchTapsY: {14}, " + "ShrinkTapsX: {15}, ShrinkTapsY: {16}, " + "MinFrameInterval: {17}, MaxFrameInterval: {18}, " + "MinBitsPerSecond: {19}, MaxBitsPerSecond: {20}", // Docs clearly say this is a format type MediaType.FormatType.GuidToString(guid), VideoStandard, InputSize.ToString(), MinCroppingSize.ToString(), MaxCroppingSize.ToString(), CropGranularityX, CropGranularityY, CropAlignX, CropAlignY, MinOutputSize.ToString(), MaxOutputSize.ToString(), OutputGranularityX, OutputGranularityY, StretchTapsX, StretchTapsY, ShrinkTapsX, ShrinkTapsY, MinFrameInterval, MaxFrameInterval, MinBitsPerSecond, MaxBitsPerSecond)); }
public static string GetClassForInputSize(InputSize textBoxSize) { if (textBoxSize == InputSize.BlockLevel) { return("input-block-level"); } if (textBoxSize == InputSize.XSmall) { return("input-xs"); } if (textBoxSize == InputSize.Small) { return("input-sm"); } if (textBoxSize == InputSize.Default) { return(""); } if (textBoxSize == InputSize.Large) { return("input-lg"); } if (textBoxSize == InputSize.XLarge) { return("input-xl"); } return(string.Empty); }
public override void BackPropagate(TrainingRun trainingRun) { var derivative = trainingRun.Input.Value.Map(_gradientFn); trainingRun.InputError = new Tensor( InputSize.Clone(), trainingRun.OutputError.Value.PointwiseMultiply(derivative) ); }
private string GetInputGroupSizeCssClass(InputSize inputGroupSize) { return(inputGroupSize switch { InputSize.Regular => null, InputSize.Small => "input-group-sm", InputSize.Large => "input-group-lg", _ => throw new InvalidOperationException(inputGroupSize.ToString()) });
/// <summary> /// Returns CSS class to render input (form-control) with desired size. /// </summary> public static string AsFormControlCssClass(this InputSize inputSize) { return(inputSize switch { InputSize.Regular => null, InputSize.Small => "form-control-sm", InputSize.Large => "form-control-lg", _ => throw new InvalidOperationException($"Unknown {nameof(InputSize)} value {inputSize}.") });
private void ввестиВручнуюToolStripMenuItem_Click(object sender, EventArgs e) { // Очищение формы Remove_Visual_Matrix(); Remove_B_Cells(); InputLabel.Visible = false; SizeChoice.Visible = true; InputSize.Visible = true; InputSize.Focus(); }
public static string GetClassForInputSize(InputSize textBoxSize) { if (textBoxSize == InputSize.Mini) return "input-mini"; if (textBoxSize == InputSize.BlockLevel) return "input-block-level"; if (textBoxSize == InputSize.Small) return "input-small"; if (textBoxSize == InputSize.Medium) return "input-medium"; if (textBoxSize == InputSize.Large) return "input-large"; if (textBoxSize == InputSize.XLarge) return "input-xlarge"; if (textBoxSize == InputSize.XXLarge) return "input-xxlarge"; return string.Empty; }
private void initControls() { TbxIpAddr.Text = IpAddr; TbxUsername.Text = Username; TbxPassword.Text = Password; BtnConnect.Content = "连接"; TbxTest.Text = ""; tbxPlatName.Text = ""; tbxPlatVen.Text = ""; tbxPlatVer.Text = ""; tbxDevName.Text = ""; tbxDevVen.Text = ""; tbxDevVer.Text = ""; tbxDevCU.Text = ""; tbxDevFreq.Text = ""; tbxDevPerf.Text = ""; lbxDevList.Items.Clear(); tbxN.Text = N.ToString(); tbxC.Text = C.ToString(); tbxH.Text = H.ToString(); tbxW.Text = W.ToString(); tbxK.Text = K.ToString(); tbxOutW.Text = OutW.ToString(); tbxOutH.Text = OutH.ToString(); tbxGroupSz.Text = String.Format("{0:D}, {1:D}, 1", group_size_x, group_size_y); tbxGlobalSz.Text = String.Format("{0:D}, {1:D}, 1", global_size_x, global_size_y); tbxPck.Text = pck_order.ToString(); tbxLdsAtomic.Text = c_lds_atomic.ToString(); tbxLdsSplit.Text = c_lds_split.ToString(); tbxL2Atomic.Text = c_l2_atomic.ToString(); tbxL2Split.Text = c_l2_split.ToString(); tbxKoutMaps.Text = k_out_maps.ToString(); tbxInSize.Text = InputSize.ToString(); tbxWeiSize.Text = WeightSize.ToString(); tbxOutSize.Text = OutputSize.ToString(); tbxSigSize.Text = sig_slot_size.ToString(); tbxL2Size.Text = l2_tmp_size.ToString(); tbxElapsed.Text = BestElapsedTime.ToString(); tbxPerf.Text = BestPerformence.ToString(); tbxEffic.Text = BestEfficiency.ToString(); tbxCalcu.Text = Calculation.ToString(); tbxtheore.Text = TheoryElapsedTime.ToString(); tbxProcess.Text = String.Format("Tunning Problem: {0:D}/{1:D}... Searching Kernel: {2:D}/{3:D}...", TunnedProblem, TotalProblem, SearchedKernel, TotalProblem); tbxPercent.Text = String.Format("{0:F2}%", SearchingPercent * 100); btnTensile.IsEnabled = false; }
public void FromFundingInformation(FundingInformation o) { PayoutLength = o.PubKeys?.PayoutAddress?.ScriptPubKey.Length ?? 0; ChangeLength = o.ChangeAddress?.ScriptPubKey.Length ?? 0; foreach (var input in o.FundingInputs ?? Array.Empty <FundingInput>()) { InputSize s = new InputSize(); if (input.MaxWitnessLength is null) { input.SetRecommendedMaxWitnessLength(); } s.MaxWitnessLength = input.MaxWitnessLength !.Value; s.ScriptSigLength = input.RedeemScript is null ? 0 : new Script(Op.GetPushOp(input.RedeemScript.ToBytes(true))).Length; Inputs.Add(s); } }
/// <summary> /// Gets the CSS class. /// </summary> /// <param name="inputSize">Size of the input.</param> /// <returns>The css class of the input size</returns> internal static string GetCssClass(InputSize inputSize) { switch (inputSize) { case InputSize.small: return "input-small"; case InputSize.medium: return "input-medium"; case InputSize.large: return "input-large"; case InputSize.xlarge: return "input-xlarge"; case InputSize.xxlarge: return "input-xxlarge"; default: return string.Empty; } }
/// <summary> /// Bootstraps the drop down list for. /// </summary> /// <typeparam name="TModel">The type of the model</typeparam> /// <typeparam name="TProperty">The type of the property</typeparam> /// <param name="htmlHelper">The HTML helper</param> /// <param name="expression">The expression</param> /// <param name="selectList">The select list.</param> /// <param name="inputSize">Size of the input</param> /// <param name="disabled">if set to <c>true</c> [disabled]</param> /// <param name="helpText">The help text</param> /// <returns>An MvcHtmlString</returns> public static MvcHtmlString BootstrapDropDownListFor <TModel, TProperty>( this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, IEnumerable <SelectListItem> selectList, InputSize inputSize = InputSize.medium, bool disabled = false, string helpText = "") { var container = Common.GetRootContainer(); var icontainer = Common.GetInputContainer(); var css = new List <string>(); var htmlAttributes = new Dictionary <string, object>(); var metadata = ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData); var error = Common.HasValidationError(htmlHelper, ExpressionHelper.GetExpressionText(expression)); if (error) { container.AddCssClass("error"); } css.Add(Common.GetCssClass(inputSize)); if (disabled) { css.Add("disabled"); htmlAttributes.Add("disabled", "disabled"); } htmlAttributes.Add("class", Common.GetCss(css)); MvcHtmlString label = Common.GetLabel(metadata.PropertyName, metadata.DisplayName); MvcHtmlString input = htmlHelper.DropDownListFor(expression, selectList, htmlAttributes); icontainer.InnerHtml = input.ToString() + Common.GetValidationMessageSpan( htmlHelper, ExpressionHelper.GetExpressionText(expression) + Common.GetHelpSpan(helpText)); container.InnerHtml = label + icontainer.ToString(); return(container.ToMvcHtmlString()); }
/// <summary> /// Gets the CSS class /// </summary> /// <param name="inputSize">The size of the input</param> /// <returns>The css class of the input size</returns> internal static string GetCssClass(InputSize inputSize) { switch (inputSize) { case InputSize.small: return("input-small"); case InputSize.medium: return("input-medium"); case InputSize.large: return("input-large"); case InputSize.xlarge: return("input-xlarge"); case InputSize.xxlarge: return("input-xxlarge"); default: return(string.Empty); } }
public IBootstrapDropDownList Size(InputSize size) { this._model.size = size; return this; }
public static TThis SetSize <THelper, TThis, TWrapper>(this Component <THelper, TThis, TWrapper> component, InputSize size) where THelper : BootstrapHelper <THelper> where TThis : FormControl <THelper, TThis, TWrapper> where TWrapper : FormControlWrapper <THelper>, new() { return(component.GetThis().ToggleCss(size)); }
public IBootstrapListBox Size(InputSize size) { this._model.size = size; return this; }
public IBootstrapDropDownList Size(InputSize size) { this._model.size = size; return(this); }
public IBootstrapListBox Size(InputSize size) { this._model.size = size; return(this); }
public static ComponentBuilder <TConfig, TFormControl> SetSize <TConfig, TFormControl>(this ComponentBuilder <TConfig, TFormControl> builder, InputSize size) where TConfig : BootstrapConfig where TFormControl : FormControl { builder.Component.ToggleCss(size); return(builder); }
/// <summary> /// Boostraps the uneditable input. /// </summary> /// <typeparam name="TModel">the type of the model.</typeparam> /// <typeparam name="TProperty">The type of the property</typeparam> /// <param name="htmlHelper">The HTML helper</param> /// <param name="expression">The expression</param> /// <param name="inputSize">The Size of the input</param> /// <returns>An MvcHtmlString</returns> public static MvcHtmlString BootstrapUneditableInput <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, InputSize inputSize = InputSize.medium) { var container = Common.GetRootContainer(); var icontainer = Common.GetInputContainer(); var disabledInput = new TagBuilder("span"); var css = new List <string>(); var htmlAttributes = new Dictionary <string, object>(); var metadata = ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData); disabledInput.AddCssClass(Common.GetCssClass(inputSize)); disabledInput.AddCssClass("uneditable-input"); disabledInput.InnerHtml = metadata.Model.ToString(); var label = Common.GetLabel(metadata.PropertyName, metadata.DisplayName); icontainer.InnerHtml = disabledInput.ToString(); container.InnerHtml = label + icontainer.ToString(); return(container.ToMvcHtmlString()); }
public void Save(string FilePath) { if (string.IsNullOrEmpty(FilePath)) { throw new ArgumentNullException("FilePath"); } var writer = XmlWriter.Create(FilePath); writer.WriteStartElement("NeuralNetwork"); writer.WriteAttributeString("Type", "BackPropagation"); // Parameters element writer.WriteStartElement("Parameters"); writer.WriteElementString("Name", Name); writer.WriteElementString("InputSize", InputSize.ToString()); writer.WriteElementString("LayerCount", LayerCount.ToString()); // Layer sizes writer.WriteStartElement("Layers"); for (int l = 0; l < LayerCount; l++) { writer.WriteStartElement("Layer"); writer.WriteAttributeString("Index", l.ToString()); writer.WriteAttributeString("Size", LayerSize[l].ToString()); writer.WriteAttributeString("Type", TransferFunctions[l].ToString()); writer.WriteEndElement(); // Layer } writer.WriteEndElement(); // Layers writer.WriteEndElement(); // Parameters writer.WriteStartElement("Weights"); for (int l = 0; l < LayerCount; l++) { writer.WriteStartElement("Layer"); writer.WriteAttributeString("Index", l.ToString()); for (int j = 0; j < LayerSize[l]; j++) { writer.WriteStartElement("Node"); writer.WriteAttributeString("Index", j.ToString()); writer.WriteAttributeString("Bias", Bias[l][j].ToString()); for (int i = 0; i < (l == 0 ? InputSize : LayerSize[l - 1]); i++) { writer.WriteStartElement("Axon"); writer.WriteAttributeString("Index", i.ToString()); writer.WriteString(Weight[l][i][j].ToString()); writer.WriteEndElement(); // Axon } writer.WriteEndElement(); // Node } writer.WriteEndElement(); // Layer } writer.WriteEndElement(); // Weights writer.WriteEndElement(); // NeuralNetwork writer.Flush(); writer.Close(); }
public T Size(InputSize size) { this._model.size = size; return((T)this); }