---
title: MPSCNNLogSoftMax
framework: metalperformanceshaders
role: symbol
role_heading: Class
path: metalperformanceshaders/mpscnnlogsoftmax
---

# MPSCNNLogSoftMax

A neural transfer function that  is useful for constructing a loss function to be minimized when training neural networks.

## Declaration

```swift
class MPSCNNLogSoftMax
```

## Overview

Overview The logarithmic softmax filter is calculated by taking the natural logarithm of the result of a softmax filter. For each feature channel per pixel in an image in a feature map, the logarithmic softmax filter computes the following:

Where R is the result channel in the pixel, N is the number of feature channels, and y=ln(x) satisfies e``ʸ``=x.

## Relationships

### Inherits From

- [MPSCNNKernel](metalperformanceshaders/mpscnnkernel.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Softmax Layers

- [MPSCNNSoftMax](metalperformanceshaders/mpscnnsoftmax.md)
- [MPSCNNLogSoftMaxGradient](metalperformanceshaders/mpscnnlogsoftmaxgradient.md)
- [MPSCNNSoftMaxGradient](metalperformanceshaders/mpscnnsoftmaxgradient.md)
