Skip to content

shylee2021/WeightedSoftmaxWithLoss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WeightedSoftmaxWithLoss

Weighted Softmax With Loss for Caffe

Installation

Copy caffe.proto to $YOUR_CAFFE_HOME/src/caffe/proto.

Copy weighted_softmax_loss_layer.hpp to $YOUR_CAFFE_HOME/include/caffe/layers.

Copy weighted_softmax_loss_layer.cpp to $YOUR_CAFFE_HOME/src/caffe/layers.

Build Caffe.

Usage

The example of prototxt of weighted softmax loss is following:

layer {
  name: "loss"
  type: "WeightedSoftmaxWithLoss"
  bottom: "bottom"
  bottom: "label"
  top: "loss"
  weighted_softmax_param {
    positions: "0,2"
    weights: "3,5"
  }
}

Write the positions that you want to assign weights in positions.

Write the weights corresponding to the position you wrote in weights.

1 will be automatically assigned to omitted positions.

Notice

GPU version(.cu) is not supported yet.

About

Caffe.proto, header, and source files about weighted softmax with loss for Caffe.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors