Git Product home page Git Product logo

caffe-weighted-samples's Introduction

Caffe with weighted samples

This is a branch of Caffe that allows training with weighted samples. The branch is experimental, so not every layer is updated to fit this new paradigm, nor are unit tests updated (yet). It might also easily break, since it has not be throughly tested.

How it works

The input data in Caffe is normally an associate array with the keys "data" and "label". The sample weights are input through this data structure by adding another key called "sample_weight". The weights should have the same shape as the labels.

Now, sample_weight can be accessed just like data and label, so we need to make sure our network's data layer loads them in:

layers { # Your data layer
    # ...
    top: "data"
    top: "label"
    top: "sample_weight"
}

Connect them to your loss layer:

layers { # Your loss layer
    name: "loss"
    type: SOFTMAX_LOSS
    bottom: "ip1"  # or whatever name it might have
    bottom: "label"
    bottom: "sample_weight"
    top: "loss"
}

Features

Read sample_weight through:

  • HDF5
  • lmdb (untested)
  • leveldb (untested)

The layers that have been made to appreciate sample_weight are:

  • SOFTMAX_LOSS (label and sample_weight should be 1D)
  • EUCLIDEAN_LOSS (label and sample_weight should be 2D)

New layers althogether include:

  • SOFTMAX_CROSS_ENTROPY_LOSS (a multi-class generalization of SIGMOID_CROSS_ENTROPY_LOSS)

For now, sample_weight is required to be specified, both in the training and testing data (even though it is not used in the latter).

Original Caffe note

Caffe is a deep learning framework developed with cleanliness, readability, and speed in mind.
Consult the project website for all documentation.

caffe-weighted-samples's People

Contributors

akosiorek avatar alfredtofu avatar arntanguy avatar beam2d avatar bhack avatar chyojn avatar dgolden1 avatar erictzeng avatar gustavla avatar jamt9000 avatar jeffdonahue avatar jyegerlehner avatar kloudkl avatar longjon avatar mavenlin avatar mohomran avatar netheril96 avatar niuzhiheng avatar ozancaglayan avatar pluskid avatar qipeng avatar rbgirshick avatar ronghanghu avatar sergeyk avatar sguada avatar shelhamer avatar ste-m5s avatar tdomhan avatar yangqing avatar yosinski avatar

Watchers

 avatar

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.