Git Product home page Git Product logo

circle-loss's Introduction

Iโ€™m looking for help with getting rid of procrastination ๐Ÿค”


Some interesting code โžก๏ธ here


C#              22 hrs 49 mins  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   67.30 %
Python          4 hrs 19 mins   โ–ˆโ–ˆโ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   12.75 %
Markdown        2 hrs 51 mins   โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   08.42 %
C++             1 hr 54 mins    โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   05.64 %
C               46 mins         โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   02.31 %

circle-loss's People

Contributors

kd610 avatar zhen8838 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

circle-loss's Issues

Why useing same y_pred for sn and sp?

According to the paper and other implementations, sn and sp should be different, but you used y_pred for both of them, could you please explain why?

Circle-Loss/circle_loss.py

Lines 128 to 129 in fc4d73a

y_pred = (y_true * (alpha_p * (y_pred - self.Delta_p)) +
(1 - y_true) * (alpha_n * (y_pred - self.Delta_n))) * self.gamma

Any idea of using circle loss in a generative model?

Hi, thanks for the awesome implementation of Circle Loss.

We know that metric learning methods can essentially create a generative model, like main_emmbed.py, we could acquire emmbeding layer's output with 3D-vector to print a spherical map.

However, I noticed that the output of the complete model was generated by a 10-dimensional fully connected layer, which means that the model is a discriminant model.

Is there any way to directly use the output of the embedding layer as a generative model to achieve classification? Like np.argmin(distance) (prototypical network)?

potential bug in batch

when i use keras with tensorflow's ImageDataGenerator, during model.fit, following shape mismatch happens. my batchsize is 128

tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found.
  (0) Invalid argument:  ConcatOp : Dimensions of inputs should match: shape[0] = [128,1] vs. shape[1] = [117,1]
	 [[node loss/dense_40_loss/concat (defined at media/src/models/circle_loss.py:129) ]]
	 [[Shape_12/_148]]
  (1) Invalid argument:  ConcatOp : Dimensions of inputs should match: shape[0] = [128,1] vs. shape[1] = [117,1]
	 [[node loss/dense_40_loss/concat (defined at mediar/src/models/circle_loss.py:129) ]]

Confusion on comments 'y_pred must be cos similarity'

For all CircleLoss implementation, there is a comment on 'y_pred must be cos similarity'. I am a little bit confused. For image classification, it should also accepts logits as y_pred. Is that correct?

Another question I have is for both CircleLoss and SparseCircleLoss, the calculation is correct only if there is one inner class pair(K = 1 for s_p). Is that correct?

Examples of PairCircleLoss

Hi there,

Really appreciate your implementation on Circle loss. I'm trying to utilize circle loss for an eye recognition task, which would use a CNN for encoding eyes and construct positive and negative similarity pairs. I think PairCircleLoss is the most suitable for this task. As the example task provided is still classical classification task, could you please provide some examples of how to use pairwise circle loss? Thank you in advance. :)

Circle Loss็š„ๅฎž็Žฐๅฏ่ƒฝๆœ‰้”™่ฏฏ

ไปฅไบŒๅˆ†็ฑป้—ฎ้ข˜ไธบไพ‹๏ผŒๅœจๅˆ†็ฑป้—ฎ้ข˜ไธญ๏ผŒไธ€ไธชbatch้‡Œๅฏ่ƒฝๆœ‰ๅคšไธชๆญฃๆ ทๆœฌ๏ผŒๅคšไธช่ดŸๆ ทๆœฌใ€‚

ๅณไธ่ƒฝ็›ดๆŽฅๅ‡่ฎพK = 1, L = N - 1

ๅ› ๆญคไธ่ƒฝ็›ดๆŽฅๆŠŠๆญฃๆ ทๆœฌ็š„ๆฆ‚็Ž‡ๅ’Œไฝœไธบๅˆ†ๅญ๏ผŒๆ‰€ๆœ‰ๆฆ‚็Ž‡ๅ’Œไฝœไธบๅˆ†ๆฏ๏ผˆ่ฐƒ็”จsoftmax_cross_entropy()ๅฎž้™…ๅš็š„ไบ‹ๆƒ…๏ผ‰

image

่ฏฆ่ง

ๅฆ‚ไฝ•็†่งฃไธŽ็œ‹ๅพ…ๅœจcvpr2020ไธญๆๅ‡บ็š„circle loss๏ผŸ - ็Ž‹ๅณฐ็š„ๅ›ž็ญ” - ็ŸฅไนŽ
https://www.zhihu.com/question/382802283/answer/1114719159

ๅฆ‚ไฝ•็†่งฃไธŽ็œ‹ๅพ…ๅœจcvpr2020ไธญๆๅ‡บ็š„circle loss๏ผŸ - Yifan Sun็š„ๅ›ž็ญ” - ็ŸฅไนŽ
https://www.zhihu.com/question/382802283/answer/1116269890

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.