wollmanlab / JSTA

14 stars 6 forks source link

error with RunningJSTA.ipynb notebook #1

Closed cornhundred closed 3 years ago

cornhundred commented 3 years ago

Hi,

I am getting an error in the cell that runs reclassify_squares which is shown below:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-19-384797d0cf5e> in <module>
     12                                                          anneal_param=0.05, flip_thresh=0.2,
     13                                                          nlayer=3, first_epochs=25, second_epochs=15,
---> 14                                                          lrs=[1e-3, 1e-4], l1_reg=1e-3)
     15 
     16 toc = time()

~/Documents/JSTA/CoreFunctions/JSTA.py in reclassify_squares(pix, pixl_true, cell_matrix, nuc, cell_assign, sc_ref, sc_ref_celltypes, all_genes, locs, clf_cell, pct_train, border_other_threshold, border_same_threshold, outer_max, inner_max, most_inner_max, dist_threshold, dist_scaling, anneal_param, flip_thresh, nlayer, first_epochs, second_epochs, lrs, l1_reg)
    621             else:
    622                 clf_log = train_nn_classifier(sub_merged_pix, sub_group_labels, clf_log,
--> 623                                               second_epochs, lrs[-1])
    624 
    625             toc = time()

~/Documents/JSTA/CoreFunctions/JSTA.py in train_nn_classifier(mp, sc, clf, epo, lrs)
    978     X_train, X_test, y_train, y_test = train_test_split(mp, sc,
    979                                                    test_size = 0.2,random_state = 0)
--> 980     for lr in lrs:
    981         adam = Adam(learning_rate = lr)
    982         clf.compile(optimizer = 'Adam',

TypeError: 'float' object is not iterable
rlittman16 commented 3 years ago

Hi, thank you for bringing this up!

I just pushed a change and tested it. It should work now. Let me know if you still have problems with this.

cornhundred commented 3 years ago

Thanks!