ChainerCV
stable
  • Installation Guide
  • ChainerCV Tutorial
  • ChainerCV Reference Manual
    • Chainer Experimental
    • Datasets
    • Evaluations
    • Experimental
    • Extensions
    • Functions
    • Links
      • Model
        • General Chain
        • Feature Extraction
        • Detection
        • Semantic Segmentation
        • Links for Multiple Tasks
        • Classifiers
      • Connection
    • Transforms
    • Visualizations
    • Utils
  • Naming Conventions
  • License
ChainerCV
  • Docs »
  • ChainerCV Reference Manual »
  • Links »
  • Classifier
  • Edit on GitHub

Classifier¶

PixelwiseSoftmaxClassifier¶

class chainercv.links.PixelwiseSoftmaxClassifier(predictor, ignore_label=-1, class_weight=None)[source]¶

A pixel-wise classifier.

It computes the loss based on a given input/label pair for semantic segmentation.

Parameters
  • predictor (Link) – Predictor network.

  • ignore_label (int) – A class id that is going to be ignored in evaluation. The default value is -1.

  • class_weight (array) – An array that contains constant weights that will be multiplied with the loss values along with the channel dimension. This will be used in chainer.functions.softmax_cross_entropy().

forward(x, t)[source]¶

Computes the loss value for an image and label pair.

Parameters
  • x (Variable) – A variable with a batch of images.

  • t (Variable) – A variable with the ground truth image-wise label.

Returns

Loss value.

Return type

Variable

to_cpu()[source]¶

Copies parameter variables and persistent values to CPU.

This method does not handle non-registered attributes. If some of such attributes must be copied to CPU, the link implementation should override device_resident_accept() to do so.

Returns: self

to_gpu(device=None)[source]¶

Copies parameter variables and persistent values to GPU.

This method does not handle non-registered attributes. If some of such attributes must be copied to GPU, the link implementation must override device_resident_accept() to do so.

Parameters

device – Target device specifier. If omitted, the current device is used.

Returns: self

Next Previous

© Copyright 2017, Preferred Networks, inc. Revision dcce9fc5.

Built with Sphinx using a theme provided by Read the Docs.