Vertical transverse isotropic (VTI) formations are commonly encountered in sedimentary basins and they are the simplest type of anisotropic formations. However, the inversion of the sonic logging data in such formations is a challenging problem for the case of wells parallel to the axis of symmetry. Most of the conventional processing techniques use only the kinematic characteristics of the wavefield, whereas sufficient information about the anisotropic parameters is contained in the amplitudes of the signal. All the elastic parameters (formation density, compressional and shear wave velocities, Thomsen parameters) cannot be retrieved without rigorous assumptions or additional data (e.g. from deviated borehole). In the present work, we perform a sonic data inversion by using a machine learning approach, more specifically, the convolutional neural network. The main advantage of the method is that the neural network processes the full waveform seismogram taking into account simultaneously the kinematic and the amplitude part of the wavefield. For the network training, a synthetic dataset was generated using the spectral element method. The results of the work demonstrate the feasibility of the method, when a seismogram is fed to the input of the neural network and elastic parameters are given as the output.