  Fast and accurate magnitude prediction is the key to the success of
earthquake early warning. We have proposed a new approach based on deep
learning for P-wave magnitude prediction (EEWNet), which takes time series data
as input instead of feature parameters. The architecture of EEWNet is
adaptively adjusted according to the length of the input, thus eliminates the
need of complicated tuning of hyperparameters for deep learning. Only the
unfiltered accelerograms of vertical components are used. EEWNet is trained on
a moderate number of data set (10,000s of records), but it achieves excellent
results in magnitude prediction compared with approaches using parameters
{\tau}log, {\tau}c and Pd.
