3 writes to Weight
Microsoft.ML.StandardTrainers (3)
Standard\LinearModelParameters.cs (3)
126Weight = weights; 198Weight = VBufferUtils.CreateEmpty<float>(len); 200Weight = new VBuffer<float>(len, Utils.Size(weights), weights, indices);
39 references to Weight
Microsoft.ML.StandardTrainers (39)
Standard\LinearModelParameters.cs (39)
67public int Count => _pred.Weight.Length; 75_pred.Weight.GetItemOrDefault(index, ref value); 88return _pred.Weight.Items(all: true).Select(iv => iv.Value).GetEnumerator(); 128_inputType = new VectorDataViewType(NumberDataViewType.Single, Weight.Length); 130if (Weight.IsDense) 131_weightsDense = Weight; 150node.AddAttribute("coefficients", Weight.DenseValues()); 202_inputType = new VectorDataViewType(NumberDataViewType.Single, Weight.Length); 205if (Weight.IsDense) 206_weightsDense = Weight; 226ctx.Writer.Write(Weight.Length); 227ctx.Writer.WriteIntArray(Weight.GetIndices()); 228ctx.Writer.WriteSingleArray(Weight.GetValues()); 251predictor["coeff"] = new JArray(Weight.DenseValues()); 268var weights = Weight; 277if (features.Length != Weight.Length) 278throw Contracts.Except("Input is of length {0} does not match expected length of weights {1}", features.Length, Weight.Length); 280var weights = Weight; 288if (_weightsDense.Length == 0 && Weight.Length > 0) 293if (_weightsDense.Length == 0 && Weight.Length > 0) 294Weight.CopyToDense(ref _weightsDense); 317if (src.Length != Weight.Length) 318throw Contracts.Except("Input is of length {0}, but predictor expected length {1}", src.Length, Weight.Length); 335first.Weight.CopyTo(ref weights); 344var subweights = sub.Weight; 365var weights = Weight; 377AnnotationUtils.GetSlotNames(schema, RoleMappedSchema.ColumnRole.Feature, Weight.Length, ref names); 379subBuilder.AddSlotNames(Weight.Length, (ref VBuffer<ReadOnlyMemory<char>> dst) => names.CopyTo(ref dst)); 380var colType = new VectorDataViewType(NumberDataViewType.Single, Weight.Length); 383builder.Add("Weights", colType, (ref VBuffer<float> dst) => Weight.CopyTo(ref dst), subBuilder.ToAnnotations()); 399Weight.CopyTo(ref weights); 528var weights = Weight; 540var weights = Weight; 552AnnotationUtils.GetSlotNames(schema, RoleMappedSchema.ColumnRole.Feature, Weight.Length, ref names); 563var weights = Weight; 600var weights = Weight; 664var weights = Weight; 685var weights = Weight; 765var weights = Weight;