27 l.
cost = calloc(1,
sizeof(
float));
34 l.
counts = calloc(90,
sizeof(
int));
35 l.
sums = calloc(90,
sizeof(
float*));
38 for(i = 0; i < 90; ++i){
39 l.
sums[i] = calloc(ids,
sizeof(
float));
52 fprintf(stderr,
"iseg\n");
70 cuda_free(l->delta_gpu);
71 cuda_free(l->output_gpu);
88 for (b = 0; b < l.
batch; ++b){
94 for (b = 0; b < l.
batch; ++b){
97 for(k = 0; k < l.
w*l.
h; ++k){
104 for(i = 0; i < ids; ++i){
105 for(k = 0; k < l.
w*l.
h; ++k){
112 memset(l.
counts, 0, 90*
sizeof(
int));
113 for(i = 0; i < 90; ++i){
119 for(k = 0; k < l.
w*l.
h; ++k){
130 float *mse = calloc(90,
sizeof(
float));
131 for(i = 0; i < 90; ++i){
134 for(k = 0; k < l.
w*l.
h; ++k){
139 for(z = 0; z < ids; ++z){
150 for(i = 0; i < 90; ++i){
151 if(!l.
counts[i])
continue;
154 printf(
"%4d, %6.3f, ", l.
counts[i], mse[i]);
155 for(j = 0; j < ids; ++j){
156 printf(
"%6.3f,", l.
sums[i][j]);
164 for(i = 0; i < 90; ++i){
165 if(!l.
counts[i])
continue;
166 for(k = 0; k < l.
w*l.
h; ++k){
169 for(j = 0; j < 90; ++j){
172 for(z = 0; z < ids; ++z){
175 if (j == i) l.
delta[index] += diff < 0? -.1 : .1;
176 else l.
delta[index] += -(diff < 0? -.1 : .1);
183 for(i = 0; i < ids; ++i){
184 for(k = 0; k < l.
w*l.
h; ++k){
186 l.
delta[index] *= .01;
206 for (b = 0; b < l.
batch; ++b){
216 void backward_iseg_layer_gpu(
const layer l,
network net)
219 for (b = 0; b < l.
batch; ++b){
void forward_iseg_layer(const layer l, network net)
void(* forward_gpu)(struct layer, struct network)
void(* backward_gpu)(struct layer, struct network)
void axpy_gpu(int N, float ALPHA, float *X, int INCX, float *Y, int INCY)
void(* forward)(struct layer, struct network)
void resize_iseg_layer(layer *l, int w, int h)
void fill_cpu(int N, float ALPHA, float *X, int INCX)
void axpy_cpu(int N, float ALPHA, float *X, int INCX, float *Y, int INCY)
void(* backward)(struct layer, struct network)
layer make_iseg_layer(int batch, int w, int h, int classes, int ids)
void scal_cpu(int N, float ALPHA, float *X, int INCX)
void copy_gpu(int N, float *X, int INCX, float *Y, int INCY)
void activate_array(float *x, const int n, const ACTIVATION a)
void activate_array_gpu(float *x, int n, ACTIVATION a)
float mag_array(float *a, int n)
double what_time_is_it_now()
void backward_iseg_layer(const layer l, network net)