---
title: MPSMatrixNeuron
framework: metalperformanceshaders
role: symbol
role_heading: Class
path: metalperformanceshaders/mpsmatrixneuron
---

# MPSMatrixNeuron

A neuron activation kernel that operates on matrices.

## Declaration

```swift
class MPSMatrixNeuron
```

## Topics

### Initializers

- [init(coder:device:)](metalperformanceshaders/mpsmatrixneuron/init(coder:device:).md)
- [init(device:)](metalperformanceshaders/mpsmatrixneuron/init(device:).md)

### Instance Properties

- [alpha](metalperformanceshaders/mpsmatrixneuron/alpha.md)
- [sourceInputFeatureChannels](metalperformanceshaders/mpsmatrixneuron/sourceinputfeaturechannels.md)
- [sourceNumberOfFeatureVectors](metalperformanceshaders/mpsmatrixneuron/sourcenumberoffeaturevectors.md)

### Instance Methods

- [copy(with:device:)](metalperformanceshaders/mpsmatrixneuron/copy(with:device:).md)
- [encode(commandBuffer:inputMatrix:biasVector:resultMatrix:)](metalperformanceshaders/mpsmatrixneuron/encode(commandbuffer:inputmatrix:biasvector:resultmatrix:).md)
- [neuronParameterA()](metalperformanceshaders/mpsmatrixneuron/neuronparametera().md)
- [neuronParameterB()](metalperformanceshaders/mpsmatrixneuron/neuronparameterb().md)
- [neuronParameterC()](metalperformanceshaders/mpsmatrixneuron/neuronparameterc().md)
- [neuronType()](metalperformanceshaders/mpsmatrixneuron/neurontype().md)
- [setNeuronToPReLUWithParametersA(_:)](metalperformanceshaders/mpsmatrixneuron/setneurontopreluwithparametersa(_:).md)
- [setNeuronType(_:parameterA:parameterB:parameterC:)](metalperformanceshaders/mpsmatrixneuron/setneurontype(_:parametera:parameterb:parameterc:).md)

## Relationships

### Inherits From

- [MPSMatrixUnaryKernel](metalperformanceshaders/mpsmatrixunarykernel.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

### Matrix Neural Network Operations

- [MPSMatrixFullyConnected](metalperformanceshaders/mpsmatrixfullyconnected.md)
- [MPSMatrixFullyConnectedGradient](metalperformanceshaders/mpsmatrixfullyconnectedgradient.md)
- [MPSMatrixNeuronGradient](metalperformanceshaders/mpsmatrixneurongradient.md)
