Efficient way for using ANN as the constitutive law

Please provide a minimal working example (Even if not efficient) to increase the likeliness to receive any help. Some pointers on how to write a minimal working example can be found at: Read before posting: How do I get my question answered?