Despite recent advancments in Micro-Electro Mechanical Systems (MEMS) inertial and magnetic sensors, percices and accurate attitude estimation is a challenging task, especillay in the existance of magnetic distubances or high dynamic motions. This problem cannot be significantly tackled by conventional methods and clasical estimators. In this paper, an end-to-end deep learning framework is develped to estimate the attitude and heading using inertial and magentic sensors obtained from a low-cost IMU. The proposed model consists of two-layer stacked bidirectional Long-Short Term Mermory (LSTM) and Feed Forward Neural Network layers. The model is trained using a large dataset of IMU measurements collected from publicly availabe datasets inertial orientaion and inertial odometry datasets.