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

about context feature in code #39

Open
binerone opened this issue Jul 5, 2020 · 0 comments
Open

about context feature in code #39

binerone opened this issue Jul 5, 2020 · 0 comments

Comments

@binerone
Copy link

binerone commented Jul 5, 2020

Hi.
When reading your code, I confused that why the context feature is implemented as in the code: $ROOT/lib/nets/network/py line:340

 global_feature, region_features = tf.split(region_features, [1, -1], axis=0)

around codes as follows

        region_features = slim.fully_connected(fc7, cfg.EMBED_DIM,
                                              weights_initializer=initializer,
                                              trainable=is_training,
                                              activation_fn=None, scope='region_features')
        if cfg.CONTEXT_FUSION:
            # global_feature [1, cfg.EMBED_DIM(512)]
            global_feature, region_features = tf.split(region_features, [1, -1], axis=0)
            batch_size = tf.shape(region_features)[0]
            # global_feature_rep [batch_size(256), cfg.EMBED_DIM(512)]
            global_feature_rep = tf.tile(global_feature, [batch_size, 1])
            gfeat_lstm_cell = rnn.BasicLSTMCell(cfg.EMBED_DIM, forget_bias=1.0,
                state_is_tuple=True)
        else:
            batch_size = tf.shape(region_features)[0]

I do not understand why $region_features$ contain the $global_feature$ in the axis 0?

thanks a lot.

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

1 participant