Help protect the Great Barrier Reef with TensorFlow on Kaggle

## 什么是模型修复？

• 更改输入数据：收集更多的数据、生成合成数据、调整不同切片的权重和采样率等1
• 干预模型：通过引入或改变模型目标、添加约束条件等方式改变模型本身2
• 对结果进行后续处理：修改模型的输出结果，或修改对输出结果的解释，从而提升模型在各个指标方面的表现3

```from tensorflow_model_remediation import min_diff
import tensorflow as tf

# Start by defining a Keras model.
original_model = ...

# Set the MinDiff weight and choose a loss.
min_diff_loss = min_diff.losses.MMDLoss()
min_diff_weight = 1.0  # Hyperparamater to be tuned.

# Create a MinDiff model.
min_diff_model = min_diff.keras.MinDiffModel(
original_model, min_diff_loss, min_diff_weight)

# Compile the MinDiff model normally.
min_diff_model.compile(...)

# Create a MinDiff Dataset and train the min_diff_model.
min_diff_model.fit(min_diff_dataset, ...)
```

## MinDiff 是什么？

MinDiff 是一种模型修复技术，旨在使两个分布均衡。在实践中，它可以通过惩罚分布差异来平衡不同数据切片的错误率。

## MinDiff 的工作方式是什么？

1Zhang, G.、Bai, B.、Zhang, J.、Bai, K.、Zhu, C.、Zhao, T. (2020)。受众特征不应该成为恶意内容的理由：通过实例加权减轻文本分类中的歧视
2Prost, F.、Qian H.、Chen, Q.、Chi, E.、Chen, J.、Beutel, A. (2019)。通过基于内核的分布匹配来更好地权衡性能和公平性
3Alabdulmohsin, I. (2020)。通过不受约束的优化进行公平分类
4Dwork, C.、Hardt, M.、Pitassi, T.、Reingold, O.、Zemel, R. (2011)。通过感知实现公平性
5Hardt, M.、Price, E.、Srebro, N. (2016)。监督式学习中的机会平等
6Chouldechova, A. (2016)。带来不同影响的公平性预测：累犯预测工具的偏差性研究

### 资源

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"没有我需要的信息" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"太复杂/步骤太多" },{ "type": "thumb-down", "id": "outOfDate", "label":"内容需要更新" },{ "type": "thumb-down", "id": "translationIssue", "label":"翻译问题" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"其他" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"易于理解" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"解决了我的问题" },{ "type": "thumb-up", "id": "otherUp", "label":"其他" }]