[null,null,["最后更新时间 (UTC):2025-05-08。"],[[["\u003cp\u003eBegin with a simple model and prioritize data pipeline setup before complex model iterations.\u003c/p\u003e\n"],["\u003cp\u003eSimple models offer valuable baselines and help assess the necessity of complex models.\u003c/p\u003e\n"],["\u003cp\u003eConsider utilizing pre-trained models or their subsections when applicable, particularly for generative AI.\u003c/p\u003e\n"],["\u003cp\u003eImplement monitoring and alerting systems for model deployment, training-serving skew, and inference servers.\u003c/p\u003e\n"]]],[],null,["# Implementing a model\n\n\u003cbr /\u003e\n\nWhen implementing a model, start simple. Most of the work in ML is on the data\nside, so getting a full pipeline running for a complex model is harder than\niterating on the model itself. After setting up your data pipeline and\nimplementing a simple model that uses a few features, you can iterate on\ncreating a better model.\n\nSimple models provide a good baseline, even if you don't end up launching them.\nIn fact, using a simple model is probably better than you think. Starting simple\nhelps you determine whether or not a complex model is even justified.\n\nTrain your own model versus using an already trained model\n----------------------------------------------------------\n\nTrained models exist for a variety of use cases and offer many\nadvantages. However, trained models only really work when the label and\nfeatures match your dataset exactly. For example, if a trained model\nuses 25 features and your dataset only includes 24 of them, the trained\nmodel will most likely make bad predictions.\n\nCommonly, ML practitioners use matching subsections of inputs from a\ntrained model for fine-tuning or transfer learning. If a trained model\ndoesn't exist for your particular use case, consider\nusing subsections from a trained model when training your own.\n| **Note:** If your solution is a generative AI model, you'll almost always fine-tune a [pre-trained model](/machine-learning/glossary#pre-trained-model) instead of training your own.\n\nFor information on trained models, see\n\n- [Trained models from TensorFlow Hub](https://www.tensorflow.org/hub)\n\n- [Trained models from Kaggle](https://www.kaggle.com/models)\n\nMonitoring\n----------\n\nDuring problem framing, consider the monitoring and alerting infrastructure your\nML solution needs.\n\n### Model deployment\n\nIn some cases, a newly trained model might be worse than the model currently in\nproduction. If it is, you'll want to prevent it from being released into\nproduction and get an alert that your automated deployment has failed.\n\n### Training-serving skew\n\nIf any of the incoming features used for inference have values that fall outside\nthe distribution range of the data used in training, you'll want to be alerted\nbecause it's likely the model will make poor predictions. For example, if your\nmodel was trained to predict temperatures for equatorial cities at sea level,\nthen your serving system should alert you of incoming data with latitudes and\nlongitudes, and/or altitudes outside the range the model was trained on.\nConversely, the serving system should alert you if the model is making\npredictions that are outside the distribution range that was seen during\ntraining.\n\n### Inference server\n\nIf you're providing inferences through an RPC system, you'll want to monitor the\nRPC server itself and get an alert if it stops providing inferences."]]