<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/FullyConnectedNetworkConfiguration/batchSize",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents34FullyConnectedNetworkConfigurationV9batchSizeSivp"
  },
  "title" : "batchSize"
}
-->

# batchSize

The number of examples to use per mini-batch.

```
var batchSize: Int
```

## Discussion

A larger batch size will speed up computation when training, as long as the batch fits in memory.

> Note: This parameter is only used by the `fitted` method. When using the `update` method it’s up to you
> to do batching.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)