حقوق الطبع والنشر (C) 2021 مجموعات السيارات Freiburg و Hannover
بينما ركزت أطراف السيارات المبكرة على تحسين خطوط أنابيب ML التقليدية وفرطها ، فإن اتجاهًا آخر في Automl هو التركيز على البحث عن العمارة العصبية. لجمع أفضل ما في العالمين معًا ، قمنا بتطوير Auto-Pytorch ، التي تعمل بشكل مشترك وقوة على تحسين بنية الشبكة ومقاييس التدريب المفرطة لتمكين التعلم العميق الآلي بالكامل (AutODL).
تم تطوير Auto-Pytorch بشكل أساسي لدعم البيانات الجدولية (التصنيف ، الانحدار) وبيانات السلاسل الزمنية (التنبؤ). تم وصف أحدث الميزات في pytorch التلقائي للبيانات الجدولية في الورقة "الجدولة التلقائية: multi-fidelity metalearning من أجل autoDL الفعال والقوة" (انظر أدناه للحصول على Bibtex Ref). يمكن العثور على تفاصيل حول Auto-Pytorch لمهام التنبؤ بسلسلة زمنية متعددة الأفقي في الورقة "التعلم العميق الآلي الفعال للتنبؤ بسلسلة زمنية" (انظر أيضًا للاطلاع على Bibtex Ref).
أيضا ، ابحث عن الوثائق هنا.
من V0.1.0 ، تم تحديث AutopyTorch لزيادة تحسين قابلية الاستخدام والمتانة والكفاءة باستخدام SMAC كحزمة التحسين الأساسية وكذلك تغيير بنية الكود. لذلك ، فإن الانتقال من V0.0.2 إلى V0.1.0 سيؤدي إلى كسر التوافق. في حال كنت ترغب في استخدام واجهة برمجة التطبيقات القديمة ، يمكنك العثور عليها على master_old .
يتم رسم الوصف الخشن لسير العمل من Auto-Pytorch في الشكل التالي.
في الشكل ، يتم توفير البيانات من قبل المستخدم والمحفظة هي مجموعة من تكوينات الشبكات العصبية التي تعمل بشكل جيد على مجموعات البيانات المتنوعة. يدعم الإصدار الحالي محفظة الجشع فقط كما هو موضح في Paper Auto-Pytorch Tabular: Multi-Fidelity Metalearning من أجل AutoDL الفعال والقوي ، يتم استخدام هذه المحفظة لتدفئة تحسين SMAC. بمعنى آخر ، نقوم بتقييم المحفظة على البيانات المقدمة كتكوينات أولية. ثم تبدأ API الإجراءات التالية:
sklearn.dummy الذي يمثل أسوأ أداء ممكن.*1: خطوط الأساس عبارة
*2: يحدد تكوين خط الأنابيب Hyperparameter اختيار المكونات ، على سبيل المثال الخوارزمية المستهدفة ، شكل الشبكات العصبية ، في كل خطوة و (التي تحدد اختيار المكونات في كل خطوة وفرطها المقابل.
pip install autoPyTorch
يتطلب التبعية التلقائية للتنبؤ بسلسلة زمنية تبعيات إضافية
pip install autoPyTorch[forecasting]
نوصي باستخدام Anaconda للتطوير على النحو التالي:
# Following commands assume the user is in a cloned directory of Auto-Pytorch
# We also need to initialize the automl_common repository as follows
# You can find more information about this here:
# https://github.com/automl/automl_common/
git submodule update --init --recursive
# Create the environment
conda create -n auto-pytorch python=3.8
conda activate auto-pytorch
conda install swig
python setup.py install
وبالمثل ، لتثبيت جميع التبعيات لـ Auto-Pytorch-TimeseriesForecasting:
git submodule update --init --recursive
conda create -n auto-pytorch python=3.8
conda activate auto-pytorch
conda install swig
pip install -e[forecasting]
باختصار:
from autoPyTorch . api . tabular_classification import TabularClassificationTask
# data and metric imports
import sklearn . model_selection
import sklearn . datasets
import sklearn . metrics
X , y = sklearn . datasets . load_digits ( return_X_y = True )
X_train , X_test , y_train , y_test =
sklearn . model_selection . train_test_split ( X , y , random_state = 1 )
# initialise Auto-PyTorch api
api = TabularClassificationTask ()
# Search for an ensemble of machine learning algorithms
api . search (
X_train = X_train ,
y_train = y_train ,
X_test = X_test ,
y_test = y_test ,
optimize_metric = 'accuracy' ,
total_walltime_limit = 300 ,
func_eval_time_limit_secs = 50
)
# Calculate test accuracy
y_pred = api . predict ( X_test )
score = api . score ( y_pred , y_test )
print ( "Accuracy score" , score )لمهام التنبؤ بالسلسلة الزمنية
from autoPyTorch . api . time_series_forecasting import TimeSeriesForecastingTask
# data and metric imports
from sktime . datasets import load_longley
targets , features = load_longley ()
# define the forecasting horizon
forecasting_horizon = 3
# Dataset optimized by APT-TS can be a list of np.ndarray/ pd.DataFrame where each series represents an element in the
# list, or a single pd.DataFrame that records the series
# index information: to which series the timestep belongs? This id can be stored as the DataFrame's index or a separate
# column
# Within each series, we take the last forecasting_horizon as test targets. The items before that as training targets
# Normally the value to be forecasted should follow the training sets
y_train = [ targets [: - forecasting_horizon ]]
y_test = [ targets [ - forecasting_horizon :]]
# same for features. For uni-variant models, X_train, X_test can be omitted and set as None
X_train = [ features [: - forecasting_horizon ]]
# Here x_test indicates the 'known future features': they are the features known previously, features that are unknown
# could be replaced with NAN or zeros (which will not be used by our networks). If no feature is known beforehand,
# we could also omit X_test
known_future_features = list ( features . columns )
X_test = [ features [ - forecasting_horizon :]]
start_times = [ targets . index . to_timestamp ()[ 0 ]]
freq = '1Y'
# initialise Auto-PyTorch api
api = TimeSeriesForecastingTask ()
# Search for an ensemble of machine learning algorithms
api . search (
X_train = X_train ,
y_train = y_train ,
X_test = X_test ,
optimize_metric = 'mean_MAPE_forecasting' ,
n_prediction_steps = forecasting_horizon ,
memory_limit = 16 * 1024 , # Currently, forecasting models use much more memories
freq = freq ,
start_times = start_times ,
func_eval_time_limit_secs = 50 ,
total_walltime_limit = 60 ,
min_num_test_instances = 1000 , # proxy validation sets. This only works for the tasks with more than 1000 series
known_future_features = known_future_features ,
)
# our dataset could directly generate sequences for new datasets
test_sets = api . dataset . generate_test_seqs ()
# Calculate test accuracy
y_pred = api . predict ( test_sets )
score = api . score ( y_pred , y_test )
print ( "Forecasting score" , score ) لمزيد من الأمثلة ، بما في ذلك تخصيص مساحة البحث ، وتذوق الرمز ، وما إلى ذلك ، قم بالبحث في مجلد examples
$ cd examples/ رمز الورقة متاح تحت examples/ensemble في فرع TPAMI.2021.3067763.
إذا كنت ترغب في المساهمة في التلقائي ، استنساخ المستودع والخروج من فرع التطوير الحالي لدينا
$ git checkout developmentهذا البرنامج هو برنامج مجاني: يمكنك إعادة توزيعه و/أو تعديله بموجب شروط ترخيص Apache 2.0 (يرجى الاطلاع على ملف الترخيص).
يتم توزيع هذا البرنامج على أمل أن يكون مفيدًا ، ولكن بدون أي ضمان ؛ بدون حتى الضمان الضمني للتسويق أو اللياقة لغرض معين.
يجب أن تكون قد تلقيت نسخة من ترخيص Apache 2.0 مع هذا البرنامج (انظر ملف الترخيص).
يرجى الرجوع إلى الفرع TPAMI.2021.3067763 لإعادة إنتاج الورق Auto-Pytorch Tabular: Multi-Fidelity Metalearning من أجل AutoDL الفعال والقوي .
@article { zimmer-tpami21a ,
author = { Lucas Zimmer and Marius Lindauer and Frank Hutter } ,
title = { Auto-PyTorch Tabular: Multi-Fidelity MetaLearning for Efficient and Robust AutoDL } ,
journal = { IEEE Transactions on Pattern Analysis and Machine Intelligence } ,
year = { 2021 } ,
note = { also available under https://arxiv.org/abs/2006.13799 } ,
pages = { 3079 - 3090 }
} @incollection { mendoza-automlbook18a ,
author = { Hector Mendoza and Aaron Klein and Matthias Feurer and Jost Tobias Springenberg and Matthias Urban and Michael Burkart and Max Dippel and Marius Lindauer and Frank Hutter } ,
title = { Towards Automatically-Tuned Deep Neural Networks } ,
year = { 2018 } ,
month = dec,
editor = { Hutter, Frank and Kotthoff, Lars and Vanschoren, Joaquin } ,
booktitle = { AutoML: Methods, Sytems, Challenges } ,
publisher = { Springer } ,
chapter = { 7 } ,
pages = { 141--156 }
} @article { deng-ecml22 ,
author = { Difan Deng and Florian Karl and Frank Hutter and Bernd Bischl and Marius Lindauer } ,
title = { Efficient Automated Deep Learning for Time Series Forecasting } ,
year = { 2022 } ,
booktitle = { Machine Learning and Knowledge Discovery in Databases. Research Track
- European Conference, {ECML} {PKDD} 2022 } ,
url = { https://doi.org/10.48550/arXiv.2205.05511 } ,
}تم تطوير Auto-Pytorch بواسطة مجموعات السيارات من جامعة فرايبورغ وهانوفر.