با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
به طور کلی، شما می توانید یک مدل را به دو روش آموزش دهید:
آموزش استاتیک (که به آن آموزش آفلاین نیز گفته می شود) به این معنی است که شما یک مدل را فقط یک بار آموزش می دهید. سپس برای مدتی به همان مدل آموزش دیده خدمت می کنید.
آموزش پویا (که به آن آموزش آنلاین نیز گفته می شود) به این معنی است که شما یک مدل را به طور مداوم یا حداقل مکرر آموزش می دهید. شما معمولاً جدیدترین مدل آموزش دیده را خدمت می کنید.
شکل 2. آموزش استاتیک. یک بار قطار؛ یک مدل ساخته شده را چندین بار خدمت کنید. (تصاویر توسط Pexels و توسط fancycrave1.) شکل 3. آموزش پویا. مرتباً بازآموزی کنید؛ جدیدترین مدل ساخته شده را ارائه می دهد. (تصاویر توسط Pexels و Couleur.)
جدول 1. مزایا و معایب اولیه.
آموزش استاتیک
آموزش پویا
مزایا
ساده تر. شما فقط باید یک بار مدل را توسعه و آزمایش کنید.
سازگارتر مدل شما با هرگونه تغییر در رابطه بین ویژگیها و برچسبها مطابقت خواهد داشت.
معایب
گاهی بیات تر. اگر رابطه بین ویژگی ها و برچسب ها در طول زمان تغییر کند، پیش بینی های مدل شما کاهش می یابد.
کار بیشتر شما باید همیشه یک محصول جدید بسازید، آزمایش کنید و منتشر کنید.
اگر مجموعه داده شما واقعاً در طول زمان تغییر نمی کند، آموزش استاتیک را انتخاب کنید زیرا ایجاد و نگهداری از آموزش پویا ارزان تر است. با این حال، مجموعه دادهها در طول زمان تغییر میکنند، حتی آنهایی که ویژگیهایی دارند که فکر میکنید مانند سطح دریا ثابت هستند. غذای آماده: حتی با آموزش استاتیک، همچنان باید داده های ورودی خود را برای تغییر کنترل کنید.
به عنوان مثال، مدلی را در نظر بگیرید که برای پیش بینی احتمال خرید گل توسط کاربران آموزش دیده است. به دلیل فشار زمانی، مدل تنها یک بار با استفاده از مجموعه داده رفتار خرید گل در ماه های جولای و آگوست آموزش داده می شود. این مدل برای چندین ماه خوب کار می کند اما پس از آن پیش بینی های وحشتناکی را در مورد روز ولنتاین انجام می دهد زیرا رفتار کاربر در آن دوره تعطیلات گل به طور چشمگیری تغییر می کند.
برای کاوش دقیق تر در مورد آموزش استاتیک و پویا، دوره مدیریت پروژه های ML را ببینید.
تمرینات: درک خود را بررسی کنید
کدام دو عبارت زیر در مورد آموزش استاتیک (آفلاین) صحیح است؟
با رسیدن داده های جدید، مدل به روز می ماند.
در واقع، اگر به صورت آفلاین تمرین میکنید، مدل هیچ راهی برای ترکیب دادههای جدید در زمان رسیدن ندارد. اگر توزیعی که میخواهید از آن بیاموزید در طول زمان تغییر کند، این میتواند منجر به کهنگی مدل شود.
شما می توانید مدل را قبل از استفاده از آن در تولید بررسی کنید.
بله، آموزش آفلاین فرصت کافی برای بررسی عملکرد مدل قبل از معرفی مدل در تولید می دهد.
آموزش آفلاین به نظارت کمتری بر مشاغل آموزشی نسبت به آموزش آنلاین نیاز دارد.
به طور کلی، الزامات نظارت در زمان آموزش برای آموزش آفلاین کمتر است، که شما را از بسیاری از ملاحظات تولید محافظت می کند. با این حال، هر چه بیشتر مدل خود را آموزش دهید، سرمایهگذاری بیشتری باید در نظارت انجام دهید. همچنین باید به طور منظم اعتبارسنجی کنید تا مطمئن شوید که تغییرات در کد شما (و وابستگیهای آن) بر کیفیت مدل تأثیر منفی نمیگذارد.
نظارت بسیار کمی بر داده های ورودی باید در زمان استنتاج انجام شود.
در مقابل، شما نیاز به نظارت بر داده های ورودی در زمان ارائه خدمات دارید. اگر توزیع های ورودی تغییر کند، پیش بینی های مدل ما ممکن است غیر قابل اعتماد شوند. برای مثال تصور کنید، مدلی که فقط بر اساس دادههای لباس تابستانی آموزش دیده است، ناگهان برای پیشبینی رفتار خرید لباس در فصل زمستان استفاده میشود.
کدام یک از عبارات زیر در مورد آموزش پویا (آنلاین) صادق است؟
با رسیدن داده های جدید، مدل به روز می ماند.
این مزیت اصلی آموزش آنلاین است. میتوانید با اجازه دادن به مدل برای آموزش دادههای جدید در هنگام ورود، از بسیاری از مشکلات کهنگی جلوگیری کنید.
نظارت بسیار کمی بر مشاغل آموزشی باید انجام شود.
در واقع، شما باید به طور مداوم مشاغل آموزشی را زیر نظر داشته باشید تا مطمئن شوید که آنها سالم هستند و طبق برنامه کار می کنند. همچنین به زیرساختهای پشتیبانی مانند توانایی بازگرداندن یک مدل به عکس قبلی در صورت بروز مشکل در آموزش، مانند کار باگ یا خرابی در دادههای ورودی، نیاز دارید.
نظارت بسیار کمی بر داده های ورودی باید در زمان استنتاج انجام شود.
درست مانند یک مدل استاتیک و آفلاین، نظارت بر ورودیهای مدلهای بهروزرسانی شده پویا نیز مهم است. شما احتمالاً در معرض خطر تأثیرات فصلی زیاد نیستید، اما تغییرات ناگهانی و بزرگ در ورودیها (مانند از بین رفتن منبع داده بالادست) همچنان میتواند باعث پیشبینیهای غیرقابل اعتماد شود.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eMachine learning models can be trained statically (once) or dynamically (continuously).\u003c/p\u003e\n"],["\u003cp\u003eStatic training is simpler but can become outdated if data patterns change, requiring data monitoring.\u003c/p\u003e\n"],["\u003cp\u003eDynamic training adapts to new data, providing more accurate predictions but demands more resources and monitoring.\u003c/p\u003e\n"],["\u003cp\u003eChoosing between static and dynamic training depends on the specific dataset and how frequently it changes.\u003c/p\u003e\n"],["\u003cp\u003eMonitoring input data is essential for both static and dynamic training to ensure reliable predictions.\u003c/p\u003e\n"]]],[],null,["# Production ML systems: Static versus dynamic training\n\nBroadly speaking, you can train a model in either of two ways:\n\n- [**Static training**](/machine-learning/glossary#static) (also called **offline training**) means that you train a model only once. You then serve that same trained model for a while.\n- [**Dynamic training**](/machine-learning/glossary#dynamic) (also called **online training**) means that you train a model continuously or at least frequently. You usually serve the most recently trained model.\n\n**Figure 2.** Static training. Train once; serve the same built model multiple times. (Images by Pexels and by fancycrave1.)\n\n**Figure 3.** Dynamic training. Retrain frequently; serve the most recently built model. (Images by Pexels and by Couleur.)\n\n**Table 1.** Primary advantages and disadvantages.\n\n| | Static training | Dynamic training |\n| Advantages | **Simpler.** You only need to develop and test the model once. | **More adaptable.** Your model will keep up with any changes to the relationship between features and labels. |\n| Disadvantages | **Sometimes staler.** If the relationship between features and labels changes over time, your model's predictions will degrade. | **More work.** You must build, test, and release a new product all the time. |\n|---------------|---------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|\n\nIf your dataset truly isn't changing over time, choose static training because\nit is cheaper to create and maintain than dynamic training. However, datasets\ntend to change over time, even those with features that you think are as\nconstant as, say, sea level. The takeaway: even with static\ntraining, you must still monitor your input data for change.\n\nFor example, consider a model trained to predict the probability that users\nwill buy flowers. Because of time pressure, the model is trained only once\nusing a dataset of flower buying behavior during July and August.\nThe model works fine for several months but then makes terrible predictions\naround [Valentine's Day](https://wikipedia.org/wiki/Valentine's_Day) because\nuser behavior during that floral holiday period changes dramatically.\n\nFor a more detailed exploration of static and dynamic training, see the\n[Managing ML Projects](/machine-learning/managing-ml-projects/pipelines)\ncourse.\n\nExercises: Check your understanding\n-----------------------------------\n\nWhich **two** of the following statements are true about static (offline) training? \nThe model stays up to date as new data arrives. \nActually, if you train offline, then the model has no way to incorporate new data as it arrives. This can lead to model staleness, if the distribution you are trying to learn from changes over time. \nYou can verify the model before applying it in production. \nYes, offline training gives ample opportunity to verify model performance before introducing the model in production. \nOffline training requires less monitoring of training jobs than online training. \nIn general, monitoring requirements at training time are more modest for offline training, which insulates you from many production considerations. However, the more frequently you train your model, the higher the investment you'll need to make in monitoring. You'll also want to validate regularly to ensure that changes to your code (and its dependencies) don't adversely affect model quality. \nVery little monitoring of input data needs to be done at inference time. \nCounterintuitively, you do need to monitor input data at serving time. If the input distributions change, then our model's predictions may become unreliable. Imagine, for example, a model trained only on summertime clothing data suddenly being used to predict clothing buying behavior in wintertime. \nWhich **one** of the following statements is true of dynamic (online) training? \nThe model stays up to date as new data arrives. \nThis is the primary benefit of online training; you can avoid many staleness issues by allowing the model to train on new data as it comes in. \nVery little monitoring of training jobs needs to be done. \nActually, you must continuously monitor training jobs to ensure that they are healthy and working as intended. You'll also need supporting infrastructure like the ability to roll a model back to a previous snapshot in case something goes wrong in training, such as a buggy job or corruption in input data. \nVery little monitoring of input data needs to be done at inference time. \nJust like a static, offline model, it is also important to monitor the inputs to the dynamically updated models. You are likely not at risk for large seasonality effects, but sudden, large changes to inputs (such as an upstream data source going down) can still cause unreliable predictions.\n| **Key terms:**\n|\n| - [Dynamic training](/machine-learning/glossary#dynamic)\n- [Static training](/machine-learning/glossary#static) \n[Help Center](https://support.google.com/machinelearningeducation)"]]