tff.simulation.baselines.landmark.create_landmark_classification_task
Stay organized with collections
Save and categorize content based on your preferences.
Creates a baseline task of image classification on GLDv2.
tff.simulation.baselines.landmark.create_landmark_classification_task(
train_client_spec: tff.simulation.baselines.ClientSpec
,
eval_client_spec: Optional[tff.simulation.baselines.ClientSpec
] = None,
use_gld23k: bool = False,
cache_dir: Optional[str] = None,
use_synthetic_data: bool = False,
debug_seed: Optional[int] = None
) -> tff.simulation.baselines.BaselineTask
The goal of the task is to minimize the sparse categorical cross entropy
between the output labels of the model and the true label of the image. A
MobilenetV2 model is created that expects input image data with a shape of
[128, 128, 3] and group normalization layers with a group number of 8.
Args |
train_client_spec
|
A tff.simulation.baselines.ClientSpec specifying how to
preprocess train client data.
|
eval_client_spec
|
An optional tff.simulation.baselines.ClientSpec
specifying how to preprocess evaluation client data. If set to None , the
evaluation datasets will use a batch_size of 64.
|
use_gld23k
|
An optional boolean. When true, a smaller version of the GLDv2
landmark dataset will be loaded. This gld23k dataset is used for faster
prototyping.
|
cache_dir
|
An optional directory to cache the downloadeded datasets. If
non-specified, they will be cached to the default cache directory cache .
|
use_synthetic_data
|
An optional boolean indicating whether to use synthetic
GLDv2 data. This option should only be used for testing purposes, in order
to avoid downloading the entire GLDv2 dataset.
|
debug_seed
|
An optional integer seed to force deterministic model
initialization. This is intended for unittesting.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-20 UTC.
[null,null,["Last updated 2024-09-20 UTC."],[],[],null,["# tff.simulation.baselines.landmark.create_landmark_classification_task\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |\n\nCreates a baseline task of image classification on GLDv2. \n\n tff.simulation.baselines.landmark.create_landmark_classification_task(\n train_client_spec: ../../../../tff/simulation/baselines/ClientSpec,\n eval_client_spec: Optional[../../../../tff/simulation/baselines/ClientSpec] = None,\n use_gld23k: bool = False,\n cache_dir: Optional[str] = None,\n use_synthetic_data: bool = False,\n debug_seed: Optional[int] = None\n ) -\u003e ../../../../tff/simulation/baselines/BaselineTask\n\nThe goal of the task is to minimize the sparse categorical cross entropy\nbetween the output labels of the model and the true label of the image. A\nMobilenetV2 model is created that expects input image data with a shape of\n\\[128, 128, 3\\] and group normalization layers with a group number of 8.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `train_client_spec` | A [`tff.simulation.baselines.ClientSpec`](../../../../tff/simulation/baselines/ClientSpec) specifying how to preprocess train client data. |\n| `eval_client_spec` | An optional [`tff.simulation.baselines.ClientSpec`](../../../../tff/simulation/baselines/ClientSpec) specifying how to preprocess evaluation client data. If set to `None`, the evaluation datasets will use a `batch_size` of 64. |\n| `use_gld23k` | An optional boolean. When true, a smaller version of the GLDv2 landmark dataset will be loaded. This gld23k dataset is used for faster prototyping. |\n| `cache_dir` | An optional directory to cache the downloadeded datasets. If non-specified, they will be cached to the default cache directory `cache`. |\n| `use_synthetic_data` | An optional boolean indicating whether to use synthetic GLDv2 data. This option should only be used for testing purposes, in order to avoid downloading the entire GLDv2 dataset. |\n| `debug_seed` | An optional integer seed to force deterministic model initialization. This is intended for unittesting. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A [`tff.simulation.baselines.BaselineTask`](../../../../tff/simulation/baselines/BaselineTask). ||\n\n\u003cbr /\u003e"]]