Exploration of diverse type of signals with our framework


In [1]:
# Scientific Python libraries
import numpy as np
import matplotlib.pyplot as plt
import mpld3
import seaborn as sn
mpld3.enable_notebook()
import sys
sys.path.append("../")
# Nexa in-house libraries
from signals.time_series_class import MixAr
from signals.aux_functions import sidekick
from input.sensors import PerceptualSpace, Sensor
from nexa.nexa import Nexa

# Visualization libraries
from visualization.sensor_clustering import visualize_cluster_matrix
from visualization.sensors import visualize_SLM
from visualization.sensors import visualize_STDM_seaborn
from visualization.time_cluster import visualize_time_cluster_matrix
from visualization.code_vectors import visualize_code_vectors


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-3377ad441741> in <module>()
     10 from signals.time_series_class import MixAr
     11 from signals.aux_functions import sidekick
---> 12 from input.sensors import PerceptualSpace, Sensor
     13 from nexa.nexa import Nexa
     14 

ImportError: No module named input.sensors

In [2]:
# Time parameters
dt = 0.1
Tmax = 400
w = 4 * (2.0 * np.pi / Tmax)

# Let's get the axuiliary class
t = np.arange(0, Tmax, dt)
sine = np.sin(w * t)
sine_phase = np.sin(w * t + np.pi)

# Plot the things here
%matplotlib inline
plt.plot(t, sine)
plt.hold(True)
plt.plot(t, sine_phase)
plt.show()



In [3]:
# Here we will calculate correlations
Nlags = 20000
Ntime_clusters = 2
Nembedding = 3  # Dimension of the embedding space

# We create the here perceptual space
aux_sensors = [Sensor(sine, dt), Sensor(sine_phase, dt)]
perceptual_space = PerceptualSpace(aux_sensors, Nlags)

# Now the Nexa object
nexa_object = Nexa(perceptual_space, Nlags, Nspatial_clusters,
                   Ntime_clusters, Nembedding)

# Calculate all the quantities
nexa_object.calculate_all()

# Build the code vectors
code_vectors = nexa_object.build_code_vectors()


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-3-cce23b1d04bb> in <module>()
      5 
      6 # We create the here perceptual space
----> 7 aux_sensors = [Sensor(sine, dt), Sensor(sine_phase, dt)]
      8 perceptual_space = PerceptualSpace(aux_sensors, Nlags)
      9 

NameError: name 'Sensor' is not defined

Visualizations

Sensor Lagged Matrix


In [24]:
fig = visualize_SLM(nexa_object)
plt.show(fig)


Visualize Spatial Clusters


In [25]:
fig  = visualize_cluster_matrix(nexa_object)



In [ ]: