This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A = model.trans_distn.A.copy() | |
labels_norep, _ = pymouse.get_norep(np.hstack(model.stateseqs)) | |
A = build_frequentist_statemap(labels_norep) | |
import spectral_clustering.spclust as sp | |
labels_norep, _ = pymouse.get_norep(np.hstack(model.stateseqs)) | |
used_labels = np.argwhere(np.bincount(labels_norep).astype('float32')/len(labels_norep) > 0.001).ravel() | |
A = A[np.ix_(used_labels,used_labels)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_,roi = get_behavior(store_name, experiments=list(train_experiments), array_names=["rect_ROI"]) | |
roi = roi['rect_ROI'] | |
height,width = roi[train_experiments[0]] | |
Parallel(n_jobs=24)(delayed(pymouse.show_syllable)(labels, | |
images, df, | |
height=height, | |
width=width, | |
which_syllable=which_syllable, | |
num_instances_to_grab=45, | |
desired_length=120) for which_syllable in np.unique(labels)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:dcb810a9650e942e8d68b058fe09b2314ef7520b461f67c444bcfcab490b6cb0" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
TypeError Traceback (most recent call last) | |
<ipython-input-3-9d64abf5b3b8> in <module>() | |
11 kappa=kappa, | |
12 train_experiments=train_experiments, | |
---> 13 test_experiments=test_experiments) | |
/home/dattalab/Code/pymouse/scripts/train_model_generalAR.py in hmm(out_file, params, store_name, train_experiments, test_experiments, datadimension, n_cpu, n_iter, max_frames_per_mouse, pca, use_ard, windowsize, featurefn, random_seed, model_dtype, **kwargs) | |
182 samples = [] | |
183 for itr in progprint_xrange(n_iter): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:afc374763139d59e6a602e272315fc2d86d189f993a55217eb7e9e6adf02a464" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://plus.google.com/hangouts/_/guoxccx7jaijdnbofw453tim2ia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [tsOffsets, instantRate] = calcCrossCorrelogram(ts1, ts2, window) | |
% INPUT: | |
% ts1 - timestamp array, center of cross-correlogram | |
% ts2 - timestamp array | |
% window - the window of the timestamps to compute, e.g. [-0.1 0.1] for | |
% 0.1 seconds around each spike in ts1. | |
% | |
% OUTPUT: | |
% tsOffsets - the offsets from each spike in ts1 that has spikes nearby | |
% instantRate - 1/ISI of each spike in ts1 that has spikes nearby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setting up the Audio Session... | |
// Initialize and configure the audio session, and add an interuption listener | |
AudioSessionInitialize(NULL, NULL, sessionInterruptionListener, self); | |
UInt32 audioCategory = kAudioSessionCategory_PlayAndRecord; | |
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(audioCategory), &audioCategory); | |
// Allow iPod audio to continue to play while the app is active. | |
UInt32 flag = 1; | |
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof(flag), &flag); |
OlderNewer