From 47528e37cf29e0f9da6885213e5aee044bed84ef Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Wed, 15 Apr 2015 08:04:38 +0000
Subject: [PATCH] crop layer scaling and trans on cpu
---
src/crop_layer.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/crop_layer.c b/src/crop_layer.c
index bc13151..e83aea2 100644
--- a/src/crop_layer.c
+++ b/src/crop_layer.c
@@ -37,6 +37,8 @@
int flip = (layer.flip && rand()%2);
int dh = rand()%(layer.h - layer.crop_height + 1);
int dw = rand()%(layer.w - layer.crop_width + 1);
+ float scale = 2;
+ float trans = -1;
if(!state.train){
flip = 0;
dh = (layer.h - layer.crop_height)/2;
@@ -53,7 +55,7 @@
}
row = i + dh;
index = col+layer.w*(row+layer.h*(c + layer.c*b));
- layer.output[count++] = state.input[index];
+ layer.output[count++] = state.input[index]*scale + trans;
}
}
}
--
Gitblit v1.10.0