updated layer input format, improved training interface