Skip to content

l_dist term when instance_num=1 #15

@AlbertHuyb

Description

@AlbertHuyb

I am using you discriminative loss function for another use. And I discovered that if instance_num==1, the l_dist term will become nan because mu_norm=[]. So I suggest to add a sentence like l_dist = tf.cond(num_instances<=1, lambda:tf.zeros(1, dtype=tf.float32), lambda:tf.reduce_mean(mu_norm)) after the calculation of l_dist term.

Do you think it's necessary? If so, may I add a pull request to your repo?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions