Jensen-holm commited on
Commit
ba1e2db
·
1 Parent(s): ffc3a3a

having some issues with backprop when trying to use the iris dataset

Browse files
Files changed (3) hide show
  1. app.py +3 -5
  2. neural_network/backprop.py +2 -2
  3. neural_network/main.py +6 -1
app.py CHANGED
@@ -41,13 +41,11 @@ def index():
41
  # in the future instead of a random data set
42
  # we should do a more real one like palmer penguins
43
 
44
- X_train, X_test, y_train, y_test = iris()
45
  return jsonify(
46
  algorithm(
47
- X_train=X_train,
48
- y_train=y_train,
49
- X_test=X_test,
50
- y_test=y_test,
51
  args=args,
52
  )
53
  )
 
41
  # in the future instead of a random data set
42
  # we should do a more real one like palmer penguins
43
 
44
+ X, y = iris()
45
  return jsonify(
46
  algorithm(
47
+ X=X,
48
+ y=y,
 
 
49
  args=args,
50
  )
51
  )
neural_network/backprop.py CHANGED
@@ -22,8 +22,8 @@ def bp(
22
  X_train: np.array,
23
  y_train: np.array,
24
  wb: dict,
25
- args: dict
26
- ):
27
  model = NeuralNetwork.from_dict(args | wb)
28
  loss_history = []
29
  for _ in range(model.epochs):
 
22
  X_train: np.array,
23
  y_train: np.array,
24
  wb: dict,
25
+ args: dict,
26
+ ) -> NeuralNetwork:
27
  model = NeuralNetwork.from_dict(args | wb)
28
  loss_history = []
29
  for _ in range(model.epochs):
neural_network/main.py CHANGED
@@ -37,7 +37,12 @@ def main(
37
  random_state=8675309,
38
  )
39
 
40
- model = bp(X_train, y_train, wb, args)
 
 
 
 
 
41
 
42
  # evaluate the model and return final results
43
  model.eval(
 
37
  random_state=8675309,
38
  )
39
 
40
+ model = bp(
41
+ X_train=X_train,
42
+ y_train=y_train,
43
+ wb=wb,
44
+ args=args,
45
+ )
46
 
47
  # evaluate the model and return final results
48
  model.eval(