Code Monkey home page Code Monkey logo

center_loss's People

Contributors

kakoedlinnoeslovo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rex-hou csuk0914

center_loss's Issues

about the centre_loss

Hi, I have a question:
def call(self, x, mask=None): ## x[0] is Nx2, x[1] is Nx10 onehot, self.centers is 10x2 delta_centers = K.dot(K.transpose(x[1]), (K.dot(x[1], self.centers) - x[0])) # 10x2 denominator = K.sum(K.transpose(x[1]), axis=1, keepdims=True) + 1 delta_centers /= denominator new_centers = self.centers - self.alpha_center * delta_centers self.add_update((self.centers, new_centers), x) self.result = (K.dot(x[1], self.centers) - x[0]) self.result = K.sum(self.result ** 2, axis=1, keepdims=True) return self.result
the call function has already contained the center loss. But in the below:
self.model.compile(optimizer=optimizer, loss=[losses.categorical_crossentropy, self.center_loss], loss_weights=[1, self.lambda_centerloss])

the compile get center_loss again and again, is that true?

problem about accuracy

image

Hi, thanks for your implement, but I have some problem about this, hope you can help me.
First, why it said "Train on 18000 samples, validate on 10000 samples", because I think we input 60000 samples for training?
Second, If we want to know the accuracy, we should only concern the val_dense_2_acc or we should concern both val_dense_2_acc and val_centerlosslayer_acc? And why val_centerlosslayer_acc always 1.0?

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.