Hướng dẫn liên kết TensorFlow
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Các hướng dẫn dựa trên colab này sẽ hướng dẫn bạn các khái niệm và API TFF chính bằng cách sử dụng các ví dụ thực tế. Tài liệu tham khảo có thể được tìm thấy trong hướng dẫn TFF .
Bắt đầu với học tập liên kết
- Học liên kết để phân loại hình ảnh giới thiệu các phần chính của API Học liên kết (FL) và trình bày cách sử dụng TFF để mô phỏng học tập liên kết trên dữ liệu giống MNIST được liên kết.
- Học liên kết để tạo văn bản trình bày rõ hơn cách sử dụng API FL của TFF để tinh chỉnh mô hình được đào tạo trước được tuần tự hóa cho tác vụ lập mô hình ngôn ngữ.
- Việc điều chỉnh các tập hợp được đề xuất cho việc học cho thấy cách tính toán FL cơ bản trong
tff.learning
có thể được kết hợp với các quy trình tổng hợp chuyên biệt mang lại sự mạnh mẽ, quyền riêng tư khác biệt, khả năng nén, v.v. - Tái thiết liên kết cho Hệ số ma trận giới thiệu một phần học tập liên kết cục bộ, trong đó một số tham số máy khách không bao giờ được tổng hợp trên máy chủ. Hướng dẫn này trình bày cách sử dụng API Học tập Liên kết để đào tạo mô hình nhân tố ma trận cục bộ một phần.
Bắt đầu với phân tích liên kết
Viết các tính toán liên kết tùy chỉnh
Các phương pháp mô phỏng tốt nhất
Hướng dẫn trung cấp và nâng cao
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["# TensorFlow Federated Tutorials\n\n\u003cbr /\u003e\n\nThese [colab-based](https://colab.research.google.com/) tutorials walk you\nthrough the main TFF concepts and APIs using practical examples. Reference\ndocumentation can be found in the [TFF guides](../get_started).\n| **Note:** TFF currently requires Python 3.9 or later, but [Google Colaboratory](https://research.google.com/colaboratory/)'s hosted runtimes currently use Python 3.7, and so in order to run these notebooks you will need to use a [custom local runtime](https://research.google.com/colaboratory/local-runtimes.html).\n\n**Getting started with federated learning**\n\n- [Federated Learning for image classification](/federated/tutorials/federated_learning_for_image_classification) introduces the key parts of the Federated Learning (FL) API, and demonstrates how to use TFF to simulate federated learning on federated MNIST-like data.\n- [Federated Learning for text generation](/federated/tutorials/federated_learning_for_text_generation) further demonstrates how to use TFF's FL API to refine a serialized pre-trained model for a language modeling task.\n- [Tuning recommended aggregations for learning](/federated/tutorials/tuning_recommended_aggregators) shows how the basic FL computations in [`tff.learning`](https://www.tensorflow.org/federated/api_docs/python/tff/learning) can be combined with specialized aggregation routines offering robustness, differential privacy, compression, and more.\n- [Federated Reconstruction for Matrix Factorization](/federated/tutorials/federated_reconstruction_for_matrix_factorization) introduces partially local federated learning, where some client parameters are never aggregated on the server. The tutorial demonstrates how to use the Federated Learning API to train a partially local matrix factorization model.\n\n**Getting started with federated analytics**\n\n- [Private Heavy Hitters](/federated/tutorials/private_heavy_hitters) shows how to use [`tff.analytics.heavy_hitters`](https://www.tensorflow.org/federated/api_docs/python/tff/analytics/heavy_hitters) to build a federated analytics computation to discover private heavy hitters.\n\n**Writing custom federated computations**\n\n- [Building Your Own Federated Learning Algorithm](/federated/tutorials/building_your_own_federated_learning_algorithm) shows how to use the TFF Core APIs to implement federated learning algorithms, using Federated Averaging as an example.\n- [Composing Learning Algorithms](/federated/tutorials/composing_learning_algorithms) shows how to use the TFF Learning API to easily implement new federated learning algorithms, especially variants of Federated Averaging.\n- [Custom Federated Algorithms, Part 1: Introduction to the Federated Core](/federated/tutorials/custom_federated_algorithms_1) and [Part 2: Implementing Federated Averaging](/federated/tutorials/custom_federated_algorithms_2) introduce the key concepts and interfaces offered by the Federated Core API (FC API).\n- [Implementing Custom Aggregations](/federated/tutorials/custom_aggregators) explains the design principles behind the [`tff.aggregators`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators) module and best practices for implementing custom aggregation of values from clients to server.\n\n**Simulation best practices**\n\n- [TFF simulation with accelerators (GPU)](/federated/tutorials/simulations_with_accelerators)\n shows how TFF's high-performance runtime can be used with GPUs.\n\n- [Working with ClientData](/federated/tutorials/working_with_client_data) gives best\n practices for integrating TFF's\n [ClientData](https://www.tensorflow.org/federated/api_docs/python/tff/simulation/datasets/ClientData)-based\n simulation datasets into TFF computations.\n\n**Intermediate and advanced tutorials**\n\n- [Random noise generation](/federated/tutorials/random_noise_generation) points out some\n subtleties with using randomness in decentralized computations, and proposes\n best practices and recommend patterns.\n\n- [Sending Different Data To Particular Clients With\n federated_language.federated_select](/federated/tutorials/federated_select) introduces the\n `federated_language.federated_select` operator and gives a simple example of\n a custom federated algorithm that sends different data to different clients.\n\n- [Client-efficient large-model federated learning via federated_select and\n sparse aggregation](/federated/tutorials/sparse_federated_learning) shows how TFF can be\n used to train a very large model where each client device only downloads and\n updates a small part of the model, using\n `federated_language.federated_select` and sparse aggregation.\n\n- [Federated Learning with Differential Privacy in TFF](/federated/tutorials/federated_learning_with_differential_privacy)\n demonstrates how to use TFF to train models with user-level differential\n privacy."]]