How to reduce the running time of my code

How can I reduce the running time of my code? is there any way to speed up the running time?

It would be helpful to provide more details about your problem, the parameters you are using, and the purpose for which you want to improve the running time (e.g. for debugging purposes or for user experience). This information will discourse members to provide better assistance.

I want to do secure inference of the simple neural network. where the client holds the neural network which is the weight of the neural network and the user holds the input.

So I am trying to implement a neural network using an arbitrary weight vector. so while doing that each layer of the neural network needs a matrix-vector multiplication(Considering it as n number of inner-product) followed by an activation function on the output vector of matrix-vector multiplication. I can see that the multiplication depth used by the n inner product is 2 and by the activation function is 3. So each layer on total use 5 multiplication depth. How can I reduce the number of multiplication depths? As well, how can I reduce the running time of the code?

For the inner product, I am doing plaintext-ciphertext multiplication.
For evaluating the activation function I used polynomial approximation with a polynomial of degree 3.

The parameter I have used –
security level- 128
firstModSize = 25
scaleModSize =24

ciphertext modulus(Q), ringdimsion(N), relin key(P), varriance of error polynomial and the secret key polynomial — all this I have not set. I can see that values are automatically set depending on the multiplication depth.