public void SetFilters(TensorOld filters) { if (Filters == null) { foreach (var item in mirrorList) { item.Filters = filters; } } TensorOld.CheckShape(filters, Filters); Array.Copy(filters.values, 0, Filters.values, 0, Filters.ElementCount); }
public void SetBias(TensorOld bias) { if (Bias == null) { foreach (var item in mirrorList) { item.Bias = bias; } } TensorOld.CheckShape(Bias, bias); Array.Copy(bias.GetRawValues(), 0, Bias.GetRawValues(), 0, Bias.ElementCount); }
/// <summary> /// 手动设置权重 /// </summary> /// <param name="weights"></param> public void SetWeights(TensorOld weights) { if (Weights == null) { foreach (var item in mirrorList) { item.Weights = weights; } } TensorOld.CheckShape(weights, Weights); Array.Copy(weights.GetRawValues(), 0, Weights.GetRawValues(), 0, Weights.ElementCount); }