  In this work we have analyzed the variation of speed of sound and trace
anomaly inside a neutron star using neural network. We construct family of
agnostic equation of state by maintaining thermodynamic stability, speed of
sound bound with constraints from recent observation of neutron stars. The data
of mass and radius serves an input for the neural network and we obtain speed
of sound as an output. The speed of sound shows non-monotonic behaviour and the
trained data predicts softer equation of state. The neural network predicts
stiff equation of state at the centre of intermediate mass stars and massive
stars have relatively softer equation of state at their centre. The trace
anomaly shows a non-monotonic behaviour for the untrained data however, when we
train our data; with neural network the trace anomaly shows monotonic behaviour
and the condition of $\Delta \ge 0$ is maintained.
