Skip to content

Commit d0f8058

Browse files
committed
updated importing functions
1 parent 15413b7 commit d0f8058

8 files changed

+118
-136
lines changed

Example_format_data.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"from scipy import io\n",
4040
"\n",
4141
"###Import functions for binning data for preprocessing###\n",
42-
"from preprocessing_funcs import bin_spikes\n",
43-
"from preprocessing_funcs import bin_output"
42+
"from Neural_Decoding.preprocessing_funcs import bin_spikes\n",
43+
"from Neural_Decoding.preprocessing_funcs import bin_output"
4444
]
4545
},
4646
{
@@ -166,21 +166,21 @@
166166
"metadata": {
167167
"anaconda-cloud": {},
168168
"kernelspec": {
169-
"display_name": "Python 2",
169+
"display_name": "Python [py35]",
170170
"language": "python",
171-
"name": "python2"
171+
"name": "Python [py35]"
172172
},
173173
"language_info": {
174174
"codemirror_mode": {
175175
"name": "ipython",
176-
"version": 2
176+
"version": 3
177177
},
178178
"file_extension": ".py",
179179
"mimetype": "text/x-python",
180180
"name": "python",
181181
"nbconvert_exporter": "python",
182-
"pygments_lexer": "ipython2",
183-
"version": "2.7.11"
182+
"pygments_lexer": "ipython3",
183+
"version": "3.5.2"
184184
}
185185
},
186186
"nbformat": 4,

Example_hyperparam_opt.ipynb

+16-16
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,21 @@
5656
"# import deepdish as dd \n",
5757
"\n",
5858
"#Import function to get the covariate matrix that includes spike history from previous bins\n",
59-
"from preprocessing_funcs import get_spikes_with_history\n",
59+
"from Neural_Decoding.preprocessing_funcs import get_spikes_with_history\n",
6060
"\n",
6161
"#Import metrics\n",
62-
"from metrics import get_R2\n",
63-
"from metrics import get_rho\n",
62+
"from Neural_Decoding.metrics import get_R2\n",
63+
"from Neural_Decoding.metrics import get_rho\n",
6464
"\n",
6565
"#Import decoder functions\n",
66-
"from decoders import WienerCascadeDecoder\n",
67-
"from decoders import WienerFilterDecoder\n",
68-
"from decoders import DenseNNDecoder\n",
69-
"from decoders import SimpleRNNDecoder\n",
70-
"from decoders import GRUDecoder\n",
71-
"from decoders import LSTMDecoder\n",
72-
"from decoders import XGBoostDecoder\n",
73-
"from decoders import SVRDecoder\n",
66+
"from Neural_Decoding.decoders import WienerCascadeDecoder\n",
67+
"from Neural_Decoding.decoders import WienerFilterDecoder\n",
68+
"from Neural_Decoding.decoders import DenseNNDecoder\n",
69+
"from Neural_Decoding.decoders import SimpleRNNDecoder\n",
70+
"from Neural_Decoding.decoders import GRUDecoder\n",
71+
"from Neural_Decoding.decoders import LSTMDecoder\n",
72+
"from Neural_Decoding.decoders import XGBoostDecoder\n",
73+
"from Neural_Decoding.decoders import SVRDecoder\n",
7474
"\n",
7575
"#Import hyperparameter optimization packages\n",
7676
"#If either are not installed, give a warning\n",
@@ -1177,21 +1177,21 @@
11771177
"metadata": {
11781178
"anaconda-cloud": {},
11791179
"kernelspec": {
1180-
"display_name": "Python 2",
1180+
"display_name": "Python [py35]",
11811181
"language": "python",
1182-
"name": "python2"
1182+
"name": "Python [py35]"
11831183
},
11841184
"language_info": {
11851185
"codemirror_mode": {
11861186
"name": "ipython",
1187-
"version": 2
1187+
"version": 3
11881188
},
11891189
"file_extension": ".py",
11901190
"mimetype": "text/x-python",
11911191
"name": "python",
11921192
"nbconvert_exporter": "python",
1193-
"pygments_lexer": "ipython2",
1194-
"version": "2.7.14"
1193+
"pygments_lexer": "ipython3",
1194+
"version": "3.5.2"
11951195
}
11961196
},
11971197
"nbformat": 4,

Examples_all_decoders.ipynb

+28-24
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@
3434
},
3535
"outputs": [
3636
{
37-
"name": "stderr",
37+
"name": "stdout",
3838
"output_type": "stream",
3939
"text": [
40-
"Using Theano backend.\n",
41-
"WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL:\n",
42-
" https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29\n",
4340
"\n",
44-
"Using gpu device 0: GeForce GTX TITAN X (CNMeM is enabled with initial size: 40.0% of memory, cuDNN 5103)\n"
41+
"WARNING: statsmodels is not installed. You will be unable to use the Naive Bayes Decoder\n"
42+
]
43+
},
44+
{
45+
"name": "stderr",
46+
"output_type": "stream",
47+
"text": [
48+
"Using Theano backend.\n"
4549
]
4650
}
4751
],
@@ -58,21 +62,21 @@
5862
"# import deepdish as dd \n",
5963
"\n",
6064
"#Import function to get the covariate matrix that includes spike history from previous bins\n",
61-
"from preprocessing_funcs import get_spikes_with_history\n",
65+
"from Neural_Decoding.preprocessing_funcs import get_spikes_with_history\n",
6266
"\n",
6367
"#Import metrics\n",
64-
"from metrics import get_R2\n",
65-
"from metrics import get_rho\n",
68+
"from Neural_Decoding.metrics import get_R2\n",
69+
"from Neural_Decoding.metrics import get_rho\n",
6670
"\n",
6771
"#Import decoder functions\n",
68-
"from decoders import WienerCascadeDecoder\n",
69-
"from decoders import WienerFilterDecoder\n",
70-
"from decoders import DenseNNDecoder\n",
71-
"from decoders import SimpleRNNDecoder\n",
72-
"from decoders import GRUDecoder\n",
73-
"from decoders import LSTMDecoder\n",
74-
"from decoders import XGBoostDecoder\n",
75-
"from decoders import SVRDecoder"
72+
"from Neural_Decoding.decoders import WienerCascadeDecoder\n",
73+
"from Neural_Decoding.decoders import WienerFilterDecoder\n",
74+
"from Neural_Decoding.decoders import DenseNNDecoder\n",
75+
"from Neural_Decoding.decoders import SimpleRNNDecoder\n",
76+
"from Neural_Decoding.decoders import GRUDecoder\n",
77+
"from Neural_Decoding.decoders import LSTMDecoder\n",
78+
"from Neural_Decoding.decoders import XGBoostDecoder\n",
79+
"from Neural_Decoding.decoders import SVRDecoder\n"
7680
]
7781
},
7882
{
@@ -105,8 +109,8 @@
105109
"# folder='/Users/jig289/Dropbox/Public/Decoding_Data/'\n",
106110
"\n",
107111
"with open(folder+'example_data_s1.pickle','rb') as f:\n",
108-
"# neural_data,vels_binned=pickle.load(f,encoding='latin1') #If using python 3\n",
109-
" neural_data,vels_binned=pickle.load(f) #If using python 2\n",
112+
" neural_data,vels_binned=pickle.load(f,encoding='latin1') #If using python 3\n",
113+
"# neural_data,vels_binned=pickle.load(f) #If using python 2\n",
110114
"\n",
111115
"# #If you would prefer to load the '.h5' example file rather than the '.pickle' example file.\n",
112116
"# data=dd.io.load(folder+'example_data_s1.h5')\n",
@@ -326,7 +330,7 @@
326330
"name": "stdout",
327331
"output_type": "stream",
328332
"text": [
329-
"('R2s:', array([ 0.72457168, 0.71731407]))\n"
333+
"R2s: [0.72457168 0.71731407]\n"
330334
]
331335
}
332336
],
@@ -710,21 +714,21 @@
710714
"metadata": {
711715
"anaconda-cloud": {},
712716
"kernelspec": {
713-
"display_name": "Python 2",
717+
"display_name": "Python [py35]",
714718
"language": "python",
715-
"name": "python2"
719+
"name": "Python [py35]"
716720
},
717721
"language_info": {
718722
"codemirror_mode": {
719723
"name": "ipython",
720-
"version": 2
724+
"version": 3
721725
},
722726
"file_extension": ".py",
723727
"mimetype": "text/x-python",
724728
"name": "python",
725729
"nbconvert_exporter": "python",
726-
"pygments_lexer": "ipython2",
727-
"version": "2.7.12"
730+
"pygments_lexer": "ipython3",
731+
"version": "3.5.2"
728732
}
729733
},
730734
"nbformat": 4,

Examples_hippocampus/Example_format_data_hc.ipynb

+16-12
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,24 @@
3333
"metadata": {
3434
"collapsed": false
3535
},
36-
"outputs": [],
36+
"outputs": [
37+
{
38+
"name": "stderr",
39+
"output_type": "stream",
40+
"text": [
41+
"Using Theano backend.\n"
42+
]
43+
}
44+
],
3745
"source": [
3846
"###Import standard packages###\n",
3947
"import numpy as np\n",
4048
"from scipy import io\n",
4149
"import sys\n",
4250
"\n",
43-
"#Add the main folder to the path, so we have access to the files there.\n",
44-
"#Note that if your working directory is not the Examples_hippocampus folder, you may need to manually specify the path to the main folder. For example: sys.path.append('/home/jglaser/GitProj/Neural_Decoding')\n",
45-
"sys.path.append('..') \n",
46-
"\n",
4751
"###Import functions for binning data for preprocessing###\n",
48-
"from preprocessing_funcs import bin_spikes\n",
49-
"from preprocessing_funcs import bin_output"
52+
"from Neural_Decoding.preprocessing_funcs import bin_spikes\n",
53+
"from Neural_Decoding.preprocessing_funcs import bin_output"
5054
]
5155
},
5256
{
@@ -173,21 +177,21 @@
173177
"metadata": {
174178
"anaconda-cloud": {},
175179
"kernelspec": {
176-
"display_name": "Python 2",
180+
"display_name": "Python [py35]",
177181
"language": "python",
178-
"name": "python2"
182+
"name": "Python [py35]"
179183
},
180184
"language_info": {
181185
"codemirror_mode": {
182186
"name": "ipython",
183-
"version": 2
187+
"version": 3
184188
},
185189
"file_extension": ".py",
186190
"mimetype": "text/x-python",
187191
"name": "python",
188192
"nbconvert_exporter": "python",
189-
"pygments_lexer": "ipython2",
190-
"version": "2.7.12"
193+
"pygments_lexer": "ipython3",
194+
"version": "3.5.2"
191195
}
192196
},
193197
"nbformat": 4,

Examples_hippocampus/Examples_decoders_hc.ipynb

+16-20
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,22 @@
5757
"import pickle\n",
5858
"import sys\n",
5959
"\n",
60-
"#Add the main folder to the path, so we have access to the files there.\n",
61-
"#Note that if your working directory is not the Examples_hippocampus folder, you may need to manually specify the path to the main folder. For example: sys.path.append('/home/jglaser/GitProj/Neural_Decoding')\n",
62-
"sys.path.append('..') \n",
63-
"\n",
6460
"#Import function to get the covariate matrix that includes spike history from previous bins\n",
65-
"from preprocessing_funcs import get_spikes_with_history\n",
61+
"from Neural_Decoding.preprocessing_funcs import get_spikes_with_history\n",
6662
"\n",
6763
"#Import metrics\n",
68-
"from metrics import get_R2\n",
69-
"from metrics import get_rho\n",
64+
"from Neural_Decoding.metrics import get_R2\n",
65+
"from Neural_Decoding.metrics import get_rho\n",
7066
"\n",
7167
"#Import decoder functions\n",
72-
"from decoders import WienerCascadeDecoder\n",
73-
"from decoders import WienerFilterDecoder\n",
74-
"from decoders import DenseNNDecoder\n",
75-
"from decoders import SimpleRNNDecoder\n",
76-
"from decoders import GRUDecoder\n",
77-
"from decoders import LSTMDecoder\n",
78-
"from decoders import XGBoostDecoder\n",
79-
"from decoders import SVRDecoder"
68+
"from Neural_Decoding.decoders import WienerCascadeDecoder\n",
69+
"from Neural_Decoding.decoders import WienerFilterDecoder\n",
70+
"from Neural_Decoding.decoders import DenseNNDecoder\n",
71+
"from Neural_Decoding.decoders import SimpleRNNDecoder\n",
72+
"from Neural_Decoding.decoders import GRUDecoder\n",
73+
"from Neural_Decoding.decoders import LSTMDecoder\n",
74+
"from Neural_Decoding.decoders import XGBoostDecoder\n",
75+
"from Neural_Decoding.decoders import SVRDecoder"
8076
]
8177
},
8278
{
@@ -556,21 +552,21 @@
556552
"metadata": {
557553
"anaconda-cloud": {},
558554
"kernelspec": {
559-
"display_name": "Python 2",
555+
"display_name": "Python [py35]",
560556
"language": "python",
561-
"name": "python2"
557+
"name": "Python [py35]"
562558
},
563559
"language_info": {
564560
"codemirror_mode": {
565561
"name": "ipython",
566-
"version": 2
562+
"version": 3
567563
},
568564
"file_extension": ".py",
569565
"mimetype": "text/x-python",
570566
"name": "python",
571567
"nbconvert_exporter": "python",
572-
"pygments_lexer": "ipython2",
573-
"version": "2.7.12"
568+
"pygments_lexer": "ipython3",
569+
"version": "3.5.2"
574570
}
575571
},
576572
"nbformat": 4,

Examples_hippocampus/Examples_kf_decoder_hc.ipynb

+9-17
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@
3939
"name": "stderr",
4040
"output_type": "stream",
4141
"text": [
42-
"Using Theano backend.\n",
43-
"WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL:\n",
44-
" https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29\n",
45-
"\n",
46-
"Using gpu device 0: GeForce GTX TITAN X (CNMeM is enabled with initial size: 40.0% of memory, cuDNN 5103)\n"
42+
"Using Theano backend.\n"
4743
]
4844
}
4945
],
@@ -57,16 +53,12 @@
5753
"import pickle\n",
5854
"import sys\n",
5955
"\n",
60-
"#Add the main folder to the path, so we have access to the files there.\n",
61-
"#Note that if your working directory is not the Examples_hippocampus folder, you may need to manually specify the path to the main folder. For example: sys.path.append('/home/jglaser/GitProj/Neural_Decoding')\n",
62-
"sys.path.append('..') \n",
63-
"\n",
6456
"#Import metrics\n",
65-
"from metrics import get_R2\n",
66-
"from metrics import get_rho\n",
57+
"from Neural_Decoding.metrics import get_R2\n",
58+
"from Neural_Decoding.metrics import get_rho\n",
6759
"\n",
6860
"#Import decoder functions\n",
69-
"from decoders import KalmanFilterDecoder"
61+
"from Neural_Decoding.decoders import KalmanFilterDecoder"
7062
]
7163
},
7264
{
@@ -447,21 +439,21 @@
447439
"metadata": {
448440
"anaconda-cloud": {},
449441
"kernelspec": {
450-
"display_name": "Python 2",
442+
"display_name": "Python [py35]",
451443
"language": "python",
452-
"name": "python2"
444+
"name": "Python [py35]"
453445
},
454446
"language_info": {
455447
"codemirror_mode": {
456448
"name": "ipython",
457-
"version": 2
449+
"version": 3
458450
},
459451
"file_extension": ".py",
460452
"mimetype": "text/x-python",
461453
"name": "python",
462454
"nbconvert_exporter": "python",
463-
"pygments_lexer": "ipython2",
464-
"version": "2.7.12"
455+
"pygments_lexer": "ipython3",
456+
"version": "3.5.2"
465457
}
466458
},
467459
"nbformat": 4,

0 commit comments

Comments
 (0)