What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-27 16:32:06
python multiply one column of array by a value
import numpy as np # Let a be some 2d array; here we just use dummy data # to illustrate the method a = np.ones((10,5)) # Multiply just the 2nd column by 5.2 in-place a[:,1] *= 5.2 # Now get the cumulative sum of just that column csum = np.cumsum(a[:,1]) Add solution -
Python 2021-09-18 22:05:03
when training= false still dropout
from keras import layers from keras import models from keras import backend as K import numpy as np inp = layers.Input(shape=(10,)) out = layers.Dropout(0.5)(inp) model = models.Model(inp, out) model.layers[-1].trainable = False # set dropout layer as ... Add solution