Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anyone have a working version of this in Python 3.7? #23

Open
quinnliu opened this issue Jan 12, 2021 · 2 comments
Open

anyone have a working version of this in Python 3.7? #23

quinnliu opened this issue Jan 12, 2021 · 2 comments

Comments

@quinnliu
Copy link

quinnliu commented Jan 12, 2021

1st of all this is an awesome repo.

Update: I have it working on Python 3.7 for science_rcn/run.py but had to make a few specific code design change to achieve the Total test accuracy = 0.7.

There were a few changes you had to make to update the code to Python 3.7. Unrelated to updating the code from Python 2.7 to Python 3.7 are the following design changes:

1 important change is in preproc.py fwd_infer(...) function I had to change

localized[localized < 1] = 0

to

localized[localized < background_threshold] = 0 & added a background_threshold=.001 function argument to fwd_infer(...)

I also changed max_cxn_length=100 in add_underconstraint_edges(...) to max_lateral_connection_pixel_length=15 to create graphs that looked like the following:

label=0_num_landmark_features=80_num_close_pairs=420_perturb_factor=2 0_max_lateral_connection_pixel_length=15_tolerance=4

NOTE: changing max_cxn_length=100 to max_cxn_length=15 did not effect the Total test accuracy = 0.7.

If you do this & rerun science_rcn/run.py with 10 train & test images instead of the default 20 you also get Total test accuracy = 0.7.

@quinnliu
Copy link
Author

I'm extremely interested in figuring out how to programmatically & automatically optimize all of the RCN model constraints such as:

  1. train_size = 10
  2. pool_shape = (25,25)
  3. perturb_factor = 2.0
  4. num_oriented_edge_features=16
  5. filter_scale=4.0
  6. gabor_size=21
  7. get_gabor_filters(...) _get_sparse_gaussian() gaussian[gaussian < 0.05 * gaussian.max()] = 0 why 0.05?
  8. brightness_diff_threshold = 40.0
  9. background_threshold=.001
  10. pooled_channel_weights = [(0, 1), (-1, 1), (1, 1)]
  11. suppress_radius=3
  12. % edge landmark features / total input image pixels = 0.00220 for above numbers on digit "0"
  13. max_lateral_connection_pixel_length = 15 =
    The maximum radius to consider adding laterals. This number is dependent on the average length of pixels between landmark feature nodes.
  14. tolerance = 4 = How much relative error to tolerate in how much two points vary relative to each other.
  15. number of edge_factors?

@lazarox
Copy link
Contributor

lazarox commented Apr 26, 2022

Updated (and somewhat simplified) code to work on Python 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants