validation ang cost trap

- implemented validate method for validating the hypothesis
- trap increasing cost function and end training