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

bad case generate by fusion net! #13

Open
ZHANG-SHI-CHANG opened this issue Sep 29, 2019 · 0 comments
Open

bad case generate by fusion net! #13

ZHANG-SHI-CHANG opened this issue Sep 29, 2019 · 0 comments

Comments

@ZHANG-SHI-CHANG
Copy link

ZHANG-SHI-CHANG commented Sep 29, 2019

good job for me!
follow is result generate by fusion net
image
some bad case in result, plus result also have bad case, but id and exp is good, do you have any idea about it?
plus:
image
id:
image
exp:
image

and what is the meaning of
bias = 0.9 * (self.m_list + self.M_list) / (self.M_list - self.m_list)
i find 0.9-->1.0 can improve expression perform

def test_generate_one(self, id_net, exp_net):
        def I(z):
            z_mean, z_log_var, z = id_net.encoder(z)
            dr_id = id_net.decoder(z)
            return dr_id
        def E(z):
            z_mean, z_log_var, z = exp_net.encoder(z)
            dr_exp = exp_net.decoder(z)
            return dr_exp
        def F(y, x):
            return self.gcn_comp([y, x])
        def load_model():
            our_model.load_weights(('../model/our_model/our_model{}{}.h5').format(self.prefix, self.suffix))

        z = self.real

        our_model = Model(z, [I(z), E(z), F(I(z), E(z))])

        if self.load:
            load_model()
            print('!!!!!!!!!!!load fusion model success!!!!!!!!!!!')

        test_dr_feature = np.fromfile(os.path.join('dr_feature', 'Tester_106', 'dr_1.dat'))
        test_dr_feature = test_dr_feature[np.newaxis, :]
        
        test_dr_feature = normalize_fromfile(test_dr_feature, self.M_list, self.m_list)

        id_code = id_net.encoder.predict(test_dr_feature, batch_size=self.batch_size)[0]
        exp_code = exp_net.encoder.predict(test_dr_feature, batch_size=self.batch_size)[0]

        print('\n')
        print(id_code)
        print(exp_code)
        print('\n')

        bias = 0.9 * (self.m_list + self.M_list) / (self.M_list - self.m_list)

        norm_id = id_net.decoder.predict(id_code, batch_size=self.batch_size)
        norm_exp = exp_net.decoder.predict(exp_code, batch_size=self.batch_size)

        plus = norm_id+norm_exp+bias
        recon = self.gcn_comp.predict([norm_id, norm_exp], batch_size=self.batch_size) + bias

        id_feature = denormalize_fromfile(norm_id, self.M_list, self.m_list)
        exp_feature = denormalize_fromfile(norm_exp, self.M_list, self.m_list)
        plus_feature = denormalize_fromfile(plus, self.M_list, self.m_list)
        recon_feature = denormalize_fromfile(recon, self.M_list, self.m_list)
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