---
title: "init(descriptor:inputWeights:hiddenWeights:peepholeWeights:biases:gateActivations:outputResultActivation:)"
framework: ML Compute
role: symbol
role_heading: Initializer
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: "mlcompute/mlclstmlayer/init(descriptor:inputweights:hiddenweights:peepholeweights:biases:gateactivations:outputresultactivation:)"
---

# init(descriptor:inputWeights:hiddenWeights:peepholeWeights:biases:gateActivations:outputResultActivation:)

Creates an LSTM layer using the descriptor, weights, biases, gate activations, and output result activation that you specify.

## Declaration

```swift
convenience init?(descriptor: MLCLSTMDescriptor, inputWeights: [MLCTensor], hiddenWeights: [MLCTensor], peepholeWeights: [MLCTensor]?, biases: [MLCTensor]?, gateActivations: [MLCActivationDescriptor], outputResultActivation: MLCActivationDescriptor)
```

## Parameters

- `descriptor`: An object you use to configure the LSTM layer.
- `inputWeights`: An array that contains tensors that describe the input weights.
- `hiddenWeights`: An array that contains tensors that describe the hidden weights.
- `peepholeWeights`: An array that contains tensors that describe the peephole weights.
- `biases`: An array that contains tensors that describe the bias terms.
- `gateActivations`: An array that contains 4 neuron descriptors for the input, hidden, cell, and output gate activations.
- `outputResultActivation`: The neuron descriptor you use for the activation function applied to output result. The default value is tanh.

## See Also

### Creating LSTM Layers

- [init(descriptor:inputWeights:hiddenWeights:biases:)](mlcompute/mlclstmlayer/init(descriptor:inputweights:hiddenweights:biases:).md)
- [init(descriptor:inputWeights:hiddenWeights:peepholeWeights:biases:)](mlcompute/mlclstmlayer/init(descriptor:inputweights:hiddenweights:peepholeweights:biases:).md)
- [MLCLSTMDescriptor](mlcompute/mlclstmdescriptor.md)
- [MLCLSTMResultMode](mlcompute/mlclstmresultmode.md)
