Added GetPatchesMatrix function and add a PachesTrainDB