def train(self, samples):
<EOL>for pattern in samples:<EOL><INDENT>self.__validate_pattern(pattern);<EOL><DEDENT>if (self._ccore_network_pointer is not None):<EOL><INDENT>return wrapper.syncpr_train(self._ccore_network_pointer, samples);<EOL><DEDENT>length = len(self);<EOL>number_samples = len(samples);<EOL>for i in range(length):<EOL><INDENT>for j in range(i + <NUM_LIT:1>, len(self), <NUM_LIT:1>):<EOL><INDENT>for p in range(number_samples):<EOL><INDENT>value1 = samples[p][i];<EOL>value2 = samples[p][j];<EOL>self._coupling[i][j] += value1 * value2;<EOL><DEDENT>self._coupling[i][j] /= length;<EOL>self._coupling[j][i] = self._coupling[i][j];<EOL><DEDENT><DEDENT>
!
        @brief Trains syncpr network using Hebbian rule for adjusting strength of connections between oscillators during training.

        @param[in] samples (list): list of patterns where each pattern is represented by list of features that are equal to [-1; 1].