File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,14 @@ def step(num):
3434
3535# Your code here:
3636# -----------------------------------------------
37- def ReLU (input_array , cutoff = 0 ):
37+ def ReLU (arr , cutoff = 0 ):
3838 """
39-
39+ Searches for values above cutoff in np array, changes them if exceeding it.
4040 """
41- return
41+ for x in arr :
42+ if arr [x ] < cutoff :
43+ arr [x ] = cutoff
44+ return arr
4245
4346
4447# -----------------------------------------------
@@ -54,7 +57,9 @@ def ReLU(input_array, cutoff=0):
5457# Your code here:
5558# -----------------------------------------------
5659
57- def neural_net_layer
60+ def neural_net_layer (arr_2d , arr_p ):
61+ arr_new = numpy .matmul (arr_2d , arr_p )
62+ return ReLU (arr_new )
5863
5964
6065- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You can’t perform that action at this time.
0 commit comments