Example #1
0
    def plot_mean_activity_3d(self, precision=20, axes=(0, 1), specific_neurons=None, weight_deform=0.5):
        '''
            Plot the mean activity of the network on a sphere/torus
        '''

        (mean_activity, feature_space1, feature_space2) = self.get_mean_activity(precision=precision, specific_neurons=specific_neurons, return_axes_vect=True, axes=axes)

        utils.plot_torus(feature_space1, feature_space2, mean_activity, weight_deform=weight_deform)
Example #2
0
    def plot_neuron_activity_3d(self, neuron_index=0, precision=20, axes=(0, 1), weight_deform=0.5, draw_colorbar=True):
        '''
            Plot the activity of a neuron on the sphere/torus
        '''

        coverage_1D = self.init_feature_space(precision)
        activity = self.get_neuron_activity(neuron_index, precision=precision, axes=axes)

        utils.plot_torus(coverage_1D, coverage_1D, activity, weight_deform=weight_deform, draw_colorbar=draw_colorbar)
Example #3
0
          n_neighbors=10,
          geod_n_neighbors=10,
          embedding_dim=3,
          verbose=True).fit()
ptu_time = round(time() - t, 2)
print('ptu time: ', ptu_time)

# Perform Isomap
t = time()
iso = Isomap(n_neighbors=10, n_components=3).fit_transform(exact)
isomap_time = round(time() - t, 2)
print('isomap time: ', isomap_time)

# Align PTU and Isomap to exact parametrization via best isometric
# transformation, and compute errors
ptu = align(ptu, exact)
iso = align(iso, exact)
ptu_error = relative_error(ptu, exact)
iso_error = relative_error(iso, exact)
print('ptu relative error: {}%'.format(ptu_error))
print('isomap relative error: {}%'.format(iso_error))

# Plot results
f = plot_torus(exact,
               ptu,
               iso,
               ptu_time,
               isomap_time,
               hue='normalized_poinwise_error')
plt.show()