Set weights for layer.

@param weights Map of weights
328851
@Override
    public void setWeights(Map<String, INDArray> weights) throws InvalidKerasConfigurationException {
        this.weights = new HashMap<>();

        INDArray dW;
        if (weights.containsKey(conf.getLAYER_PARAM_NAME_DEPTH_WISE_KERNEL()))
            dW = weights.get(conf.getLAYER_PARAM_NAME_DEPTH_WISE_KERNEL());
        else
            throw new InvalidKerasConfigurationException(
                    "Keras DepthwiseConvolution2D layer does not contain parameter "
                            + conf.getLAYER_PARAM_NAME_DEPTH_WISE_KERNEL());

        this.weights.put(SeparableConvolutionParamInitializer.DEPTH_WISE_WEIGHT_KEY, dW);
        if (hasBias) {
            INDArray bias;
            if (kerasMajorVersion == 2 && weights.containsKey("bias"))
                bias = weights.get("bias");
            else if (kerasMajorVersion == 1 && weights.containsKey("b"))
                bias = weights.get("b");
            else
                throw new InvalidKerasConfigurationException(
                        "Keras DepthwiseConvolution2D layer does not contain bias parameter");
            this.weights.put(SeparableConvolutionParamInitializer.BIAS_KEY, bias);

        }

    }
1051245
public void setNetworkLoadBalancerArns(java.util.Collection<String> networkLoadBalancerArns) {
        if (networkLoadBalancerArns == null) {
            this.networkLoadBalancerArns = null;
            return;
        }

        this.networkLoadBalancerArns = new com.amazonaws.internal.SdkInternalList<String>(networkLoadBalancerArns);
    }
187485
public void setDesiredWeightsAndCapacities(java.util.Collection<DesiredWeightAndCapacity> desiredWeightsAndCapacities) {
        if (desiredWeightsAndCapacities == null) {
            this.desiredWeightsAndCapacities = null;
            return;
        }

        this.desiredWeightsAndCapacities = new java.util.ArrayList<DesiredWeightAndCapacity>(desiredWeightsAndCapacities);
    }
917142
public static <K> void updateWeights(double l1, double learningRate, Map<K, Double> weights, Map<K, Double> newWeights) {
        if(l1 > 0.0) {
            /*
            //SGD-L1 (Naive)
            for(Map.Entry<K, Double> e : weights.entrySet()) {
                K column = e.getKey();
                newWeights.put(column, newWeights.get(column) + l1*Math.signum(e.getValue())*(-learningRate));
            }
            */
            //SGDL1 (Clipping)
            for(Map.Entry<K, Double> e : newWeights.entrySet()) {
                K column = e.getKey();
                double wi_k_intermediate = e.getValue(); //the weight wi_k+1/2 as seen on the paper
                if(wi_k_intermediate > 0.0) {
                    newWeights.put(column, Math.max(0.0, wi_k_intermediate - l1*wi_k_intermediate));

                }
                else if(wi_k_intermediate < 0.0) {
                    newWeights.put(column, Math.min(0.0, wi_k_intermediate + l1*wi_k_intermediate));
                }
            }
        }
    }
1192821
function() {
    this.links.forEach(link => {
      link.labelCount.forEach((count, label) => {
        link.labelWeight.set(label, count / this.numExamples.get(label))
      })
    })
    this.weightsNeedBuilding = false
  }
203594
def initialize(self):
        
        print("Initializing '%s' weights..." % self.name, end=" ", file=sys.stderr)
        if self.sharedWeights:
            raise AttributeError("shared weights broken")
        self.count = 0
        for connection in self.connections:
            connection.initialize()
        for layer in self.layers:
            layer.initialize()
767995
public void setLoadBalancers(java.util.Collection<LoadBalancerState> loadBalancers) {
        if (loadBalancers == null) {
            this.loadBalancers = null;
            return;
        }

        this.loadBalancers = new com.amazonaws.internal.SdkInternalList<LoadBalancerState>(loadBalancers);
    }
420005
public void setLayers(java.util.Collection<Layer> layers) {
        if (layers == null) {
            this.layers = null;
            return;
        }

        this.layers = new java.util.ArrayList<Layer>(layers);
    }
1286134
public void setWeight(int s, int t, double w) {
        DiEdge e = edge(s, t);
        assertEdge(e);
        weights.put(e, w);
    }
775326
public void setAttributes(java.util.Collection<LoadBalancerAttribute> attributes) {
        if (attributes == null) {
            this.attributes = null;
            return;
        }

        this.attributes = new java.util.ArrayList<LoadBalancerAttribute>(attributes);
    }
878954
public void setLayer(VectorLayer layer) {
		this.layer = layer;
		if (layer == null) {
			clear();
		} else {
			empty();
			updateFields();
		}
	}
1062951
public synchronized void start(List<Long> weights) throws InterruptedException {
        for (int i = 0; i < weights.size(); i++) {
            this.weights.add(weights.get(i));
        }

        int number = latch.decrementAndGet();
        if (number == 0) {
            Long initWeight = this.weights.peek();
            if (initWeight != null) {
                barrier.single(initWeight);
            }
        }
    }
266915
@Override
  public void put(double val, double weight) {
    if(weight == 0.) {
      return;
    }
    if(n <= 0) {
      n = weight;
      sum = val * weight;
      return;
    }
    val *= weight;
    final double tmp = n * val - sum * weight;
    final double oldn = n; // tmp copy
    n += weight;
    sum += val;
    m2 += tmp * tmp / (weight * n * oldn);
  }
893169
protected void set(double values[][])
    {
        super.set(values);
        nRows = nCols = Math.min(nRows, nCols);
    }
1014421
public void setWeight(int i, double w)
    {
        if(i >= size() || i < 0)
            throw new IndexOutOfBoundsException("Dataset has only " + size() + " members, can't access index " + i );
        else if(Double.isNaN(w) || Double.isInfinite(w) || w < 0)
            throw new ArithmeticException("Invalid weight assignment of  " + w);
        
        if(w == 1 && weights == null)
            return;//nothing to do, already handled implicitly
        
        if(weights == null)//need to init?
        {
            weights = new double[size()];
            Arrays.fill(weights, 1.0);
        }
        
        //make sure we have enouh space
        if (weights.length <= i)
            weights = Arrays.copyOfRange(weights, 0, Math.max(weights.length*2, i+1));
        
        weights[i] = w;
    }
795981
public ZStoreArgs weights(double... weights) {

        LettuceAssert.notNull(weights, "Weights must not be null");

        this.weights = new ArrayList<>(weights.length);

        for (double weight : weights) {
            this.weights.add(weight);
        }
        return this;
    }
172234
public void setStartUpWeight(Integer weight) {
        //save previous weight to see if we need to try to remove and add it again to the list
        this.previousWeight = this.startUpWeight;
        
        if (weight != null) {
            if (weight.intValue() >= 0)
                this.startUpWeight = weight;
            else
                this.startUpWeight = DEFAULT_STARTUP;
        } else {
            this.startUpWeight = DEFAULT_STARTUP;
        }
        if (this.context != null)
            this.context.addToStartWeightList(this);
    }