---
# System prepended metadata

title: Aggregator

---

# Aggregator

## DXOAggregator
```json=
      "id": "aggregator",
      "path": "nvflare.app_common.aggregators.dxo_aggregator.DXOAggregator",
      "args": {
      }
```

套用這個設定會有在訓練時server自動停止的狀況，暫不清楚原因為何

## InTimeAccumulateWeightedAggregator(建議)

```json=
      "id": "aggregator",
      "path": "nvflare.app_common.aggregators.intime_accumulate_model_aggregator.InTimeAccumulateWeightedAggregator",
      "args": {
        "expected_data_kind": "WEIGHT_DIFF"
      }
```

參數:
* exclude_vars(選擇，預設為無)
    * 格式: Union[str, Dict[str, str]]
* aggregation_weights(選擇，預設為無)
    * 格式: Union[Dict[str, Any], Dict[str, Dict[str, Any]]]
* expected_data_kind(預設WEIGHT_DIFF)
    * 格式: Union[DataKind, Dict[str, DataKind]]

DataKind(資料類型，不同的模型傳遞的資料類型不同)

    ANALYTIC= 'ANALYTIC'¶
    COLLECTION= 'COLLECTION'¶
    METRICS= 'METRICS'¶
    STATISTICS= 'STATISTICS'¶
    WEIGHTS= 'WEIGHTS'¶
    WEIGHT_DIFF= 'WEIGHT_DIFF'¶
    XGB_MODEL= 'XGB_MODEL'¶


## WeightedAggregationHelper

```json=
      "id": "aggregator",
      "path": "nvflare.app_common.aggregators.weighted_aggregation_helper.WeightedAggregationHelper",
      "args": {
        "expected_data_kind": "WEIGHT_DIFF"
      }
```
套用這個設定會有在訓練時server自動停止的狀況，暫不清楚原因為何

[參考資料](https://nvflare.readthedocs.io/en/2.2.1/apidocs/nvflare.app_common.aggregators.html)