Hello,
I’m trying to use Numba to speedup my code but i get this following error:
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) No implementation of function Function(np.random.binomial) found for signature: >>> <unknown function>(array(float64, 2d, C), float64) There are 2 candidate implementations: - Of which 2 did not match due to: Overload in function 'Numpy_negative_binomial.generic': File: numba\core\typing\randomdecl.py: Line 171. With argument(s): '(array(float64, 2d, C), float64)': No match for registered cases: * (int64, float64) -> int64 During: resolving callee type: Function(np.random.binomial) def train(X, y, classes, words, hidden_neurons=10, alpha=1, epochs=50000, dropout=False, dropout_percent=0.5): <source elided> negative_dropout = 1 - dropout_percent binomial = np.random.binomial(arr, negative_dropout) ^
This is the code snippet providing the error:
for j in iter(range(epochs + 1)): # Feed forward through layers 0, 1, and 2 layer_0 = X.astype(np.float64) layer_1 = sigmoid(np.dot(layer_0, synapse_0)) if dropout: arr = np.ones((len(X), hidden_neurons)) negative_dropout = 1 - dropout_percent binomial = np.random.binomial(arr, negative_dropout) layer_1 *= binomial[0] * (1.0 / negative_dropout) layer_2 = sigmoid(np.dot(layer_1, synapse_1)) [...]
How do I solve this problem?