move nn data processing and training procedures into a function
add data processing and training procedures as functions