Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

RCN implementation on a small train and test set #93

Closed

Conversation

shrinuKushagra
Copy link
Contributor

@shrinuKushagra shrinuKushagra commented Nov 8, 2021

This PR contains the first implementation of the RCN example using the PGMax package.
The file to run is examples/rcn/inference_pgmax_small.py
This code contains implementation, visualization on a small set. Trained with 20 examples and tested on 20 examples.

The inference has been separated from model creation code.
Saved models are added to /storage/users/skushagra/pgmax_rcn_artifacts/ .

Implementation on the full dataset will be implemented in a later PR.

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2021

Codecov Report

Merging #93 (031e1ed) into master (2f389ab) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #93   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          631       631           
=========================================
  Hits           631       631           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f389ab...031e1ed. Read the comment docs.

@shrinuKushagra shrinuKushagra changed the title commit for current implementation after re-creating fork RCN implementation on a small train and test set Nov 15, 2021
@shrinuKushagra shrinuKushagra marked this pull request as ready for review November 15, 2021 03:19
@StannisZhou
Copy link
Contributor

Can we get the (standalone) notebook in a separate PR? The notebook should be self-contained (without reference to other files). We can keep this PR for later evaluation on the full test set.

i1, i2, r = e
fg.add_factor(
[(idx, i1), (idx, i2)],
phis[r],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can easily construct these phis on demand so probably better to construct them instead of loading them from disk.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Computing phi involves the following code

rows = []
cols = []
index = 0
for i in range(1, M):
    r1, c1 = index_to_rc(i, hps, vps)

    r2_min = max(r1 - r, -hps)
    r2_max = min(r1 + r, hps)
    c2_min = max(c1 - r, -vps)
    c2_max = min(c1 + r, vps)

    for r2 in range(r2_min, r2_max + 1):
        for c2 in range(c2_min, c2_max + 1):
            j = rc_to_index(r2, c2, hps, vps)
            rows.append(i)
            cols.append(j)
            index += 1

which is not too complicated. For simplicity of the current notebook; I didnt include it in the example. We can include it if you think it helps the presentation.

@shrinuKushagra shrinuKushagra force-pushed the rcn_example branch 2 times, most recently from 69891ca to 787b573 Compare November 19, 2021 00:25
@NishanthJKumar
Copy link
Contributor

This PR seems stale and redundant given #96 has been merged. Should we close?

@StannisZhou
Copy link
Contributor

This PR seems stale and redundant given #96 has been merged. Should we close?
Good call. Closed!

@shrinuKushagra shrinuKushagra deleted the rcn_example branch January 24, 2022 19:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants