Branch Coverage

blib/lib/AI/NeuralNet/Kohonen.pm
Criterion Covered Total %
branch 59 122 48.3


line true false branch
179 4 0 unless defined $$self{'missing_mask'}
180 1 3 if defined $$self{'table'}
181 0 4 if defined $$self{'input_file'}
182 1 3 unless (defined $$self{'input'})
187 1 2 unless defined $$self{'map_dim_x'}
188 1 2 unless defined $$self{'map_dim_y'}
190 0 3 if ($$self{'map_dim'})
193 0 3 if (not defined $$self{'map_dim_x'} or $$self{'map_dim_x'} == 0 or not defined $$self{'map_dim_y'} or $$self{'map_dim_y'} == 0)
197 1 2 if ($$self{'map_dim_x'} > $$self{'map_dim_y'}) { }
202 3 0 unless $$self{'neighbour_factor'}
203 2 1 unless defined $$self{'epochs'}
204 0 3 if $$self{'epochs'} < 1
205 3 0 unless $$self{'time_constant'}
206 3 0 unless $$self{'learning_rate'}
208 0 3 unless ($$self{'weight_dim'})
228 0 3 unless $$self{'weight_dim'}
229 0 3 unless $$self{'map_dim_x'}
230 0 3 unless $$self{'map_dim_y'}
251 0 0 unless $$self{'weight_dim'}
252 0 0 unless $$self{'map_dim_x'}
253 0 0 unless $$self{'map_dim_y'}
310 1 0 unless defined $epochs
311 0 1 if exists $$self{'train_start'}
314 0 2 if exists $$self{'epoch_start'}
321 2 0 if exists $$self{'epoch_end'}
323 1 0 if $$self{'train_end'}
361 14 2296 if $x == 0 and $y == 0
362 41 2269 if $distance < $$closest[0]
381 0 0 if $x < 0 or $y < 0 or $x > $$self{'map_dim_x'} or $y > $$self{'map_dim_y'}
407 1 3 if (not defined $targets) { }
3 0 elsif (not $targets eq $$self{'input'}) { }
411 1 4 if ref $_ eq 'AI::NeuralNet::Kohonen::Input'
424 4 0 wantarray ? :
483 0 0 if not $smooth and defined $$self{'smoothing'}
484 0 0 unless $smooth
523 0 0 unless (open IN, $path)
545 0 0 unless (open OUT, ">$path")
552 0 0 if (not defined $$self{'display'}) { }
569 0 0 if ($$_{'class'})
586 1 0 unless (defined $_[1])
587 0 1 if (ref $_[0] eq 'ARRAY') { }
600 0 1 if (not defined $display and exists $$self{'display'}) { }
1 0 elsif (not defined $display) { }
0 0 elsif ($display eq 'hexa') { }
0 0 elsif ($display eq 'rect') { }
611 0 1 if defined $_
614 0 1 if defined $_
635 6 0 if (not $$self{'targeting'}) { }
642 0 0 if ($$self{'tar'} > $#{$$self{'input'};})
697 0 12 if $x < 0 or $x > $$self{'map_dim_x'}
699 0 30 if $y < 0 or $y > $$self{'map_dim_y'}
702 12 18 if ($$bmu[1] - $x) * ($$bmu[1] - $x) + ($$bmu[2] - $y) * ($$bmu[2] - $y) > $neighbour_radius * $neighbour_radius
707 0 54 if $$target{'values'}[$w] eq $$self{'map'}[$x][$y]{'missing_mask'}
784 0 1 if (not defined $targets) { }
788 0 1 if (not ref $_ or ref $_ ne 'ARRAY')
800 0 1 if ($#{$$self{'map'}[0][1]{'weight'};} != $$targets[0]{'dim'})
829 0 3 if /^$/ or not defined $$self{'weight_dim'}
831 0 3 if $#i < $$self{'weight_dim'}
840 3 0 if $i[$$self{'weight_dim'} + 1]
841 0 3 if $i[$$self{'weight_dim'} + 2]
842 0 3 if $i[$$self{'weight_dim'} + 3]