示例#1
0
import numpy as np
import pandas as pd

from pyglmnet import GLMCV
from spykes.ml.strf import STRF

import matplotlib.pyplot as plt
from tempfile import TemporaryDirectory

########################################################
# Download and fetch data files

from pyglmnet.datasets import fetch_tikhonov_data

with TemporaryDirectory(prefix="tmp_glm-tools") as temp_dir:
    dpath = fetch_tikhonov_data(dpath=temp_dir)
    fixations_df = pd.read_csv(op.join(dpath, 'fixations.csv'))
    probes_df = pd.read_csv(op.join(dpath, 'probes.csv'))
    probes_df = pd.read_csv(op.join(dpath, 'probes.csv'))
    spikes_df = pd.read_csv(op.join(dpath, 'spiketimes.csv'))

spiketimes = np.squeeze(spikes_df.values)

########################################################
# Design spatial basis functions

n_spatial_basis = 36
n_temporal_basis = 7
strf_model = STRF(patch_size=50,
                  sigma=5,
                  n_spatial_basis=n_spatial_basis,
示例#2
0
import os.path as op
import numpy as np
import pandas as pd

from pyglmnet import GLMCV
from spykes.ml.strf import STRF

import matplotlib.pyplot as plt

########################################################
# Download and fetch data files

from pyglmnet.datasets import fetch_tikhonov_data

dpath = fetch_tikhonov_data(dpath='/tmp/glm-tools')

fixations_df = pd.read_csv(op.join(dpath, 'fixations.csv'))
probes_df = pd.read_csv(op.join(dpath, 'probes.csv'))
probes_df = pd.read_csv(op.join(dpath, 'probes.csv'))
spikes_df = pd.read_csv(op.join(dpath, 'spiketimes.csv'))

spiketimes = np.squeeze(spikes_df.values)

########################################################
# Design spatial basis functions

n_spatial_basis = 36
n_temporal_basis = 7
strf_model = STRF(patch_size=50,
                  sigma=5,
示例#3
0
########################################################
# Imports

import numpy as np
import pandas as pd

from pyglmnet import GLM
from spykes.strf import STRF

import matplotlib.pyplot as plt

########################################################
# Download and fetch data files

from pyglmnet.datasets import fetch_tikhonov_data
fixations_df, probes_df, spikes_df = fetch_tikhonov_data(
    dpath='/tmp/glm-tools')
spiketimes = np.squeeze(spikes_df.values)

########################################################
# Design spatial basis functions

n_spatial_basis = 36
n_temporal_basis = 7
strf_model = STRF(patch_size=50,
                  sigma=5,
                  n_spatial_basis=n_spatial_basis,
                  n_temporal_basis=n_temporal_basis)
spatial_basis = strf_model.make_gaussian_basis()
strf_model.visualize_gaussian_basis(spatial_basis)

########################################################
示例#4
0
########################################################
# Imports

import numpy as np
import pandas as pd

from pyglmnet import GLM
from spykes.strf import STRF

import matplotlib.pyplot as plt

########################################################
# Download and fetch data files

from pyglmnet.datasets import fetch_tikhonov_data
fixations_df, probes_df, spikes_df = fetch_tikhonov_data(dpath='/tmp/glm-tools')
spiketimes = np.squeeze(spikes_df.values)

########################################################
# Design spatial basis functions

n_spatial_basis = 36
n_temporal_basis = 7
strf_model = STRF(patch_size=50, sigma=5,
                  n_spatial_basis=n_spatial_basis,
                  n_temporal_basis=n_temporal_basis)
spatial_basis = strf_model.make_gaussian_basis()
strf_model.visualize_gaussian_basis(spatial_basis)

########################################################
# Design temporal basis functions
示例#5
0
import os.path as op

import numpy as np
import pandas as pd

from pyglmnet import GLMCV
from spykes.ml.strf import STRF

import matplotlib.pyplot as plt

########################################################
# Download and fetch data files

from pyglmnet.datasets import fetch_tikhonov_data

dpath = fetch_tikhonov_data()
fixations_df = pd.read_csv(op.join(dpath, 'fixations.csv'))
probes_df = pd.read_csv(op.join(dpath, 'probes.csv'))
spikes_df = pd.read_csv(op.join(dpath, 'spiketimes.csv'))
spiketimes = np.squeeze(spikes_df.values)

########################################################
# Design spatial basis functions

n_spatial_basis = 36
n_temporal_basis = 7
strf_model = STRF(patch_size=50,
                  sigma=5,
                  n_spatial_basis=n_spatial_basis,
                  n_temporal_basis=n_temporal_basis)
spatial_basis = strf_model.make_gaussian_basis()