def get_capture_size(state, maximum=8):
 planes = np.zeros((maximum, state.size, state.size))
 for (x, y) in state.get_legal_moves():
  n_captured = 0
  for neighbor_group in state.get_groups_around((x, y)):
   (gx, gy) = next(iter(neighbor_group))
   if ((state.liberty_counts[gx][gy] == 1) and (state.board[(gx, gy)] != state.current_player)):
    n_captured += len(state.group_sets[gx][gy])
  planes[(min(n_captured, (maximum - 1)), x, y)] = 1
 return planes

def get_capture_size ( state , maximum = 8 ) : planes = np . zeros ( ( maximum , state . size , state . size ) ) for ( x , y ) in state . get_legal_moves ( ) : n_captured = 0 for neighbor_group in state . get_groups_around ( ( x , y ) ) : ( gx , gy ) = next ( iter ( neighbor_group ) ) if ( ( state . liberty_counts [ gx ] [ gy ] == 1 ) and ( state . board [ ( gx , gy ) ] != state . current_player ) ) : n_captured += len ( state . group_sets [ gx ] [ gy ] ) planes [ ( min ( n_captured , ( maximum - 1 ) ) , x , y ) ] = 1 return planes
a feature encoding the number of opponent stones that would be captured by playing at each location .