Skip to content

Commit 6739e0d

Browse files
committed
numpy correlate/convolve mode keywords changed
1 parent ff23733 commit 6739e0d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tf_conv1D_vs_corr_conv.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@
138138
"res = np.array(res)\n",
139139
"# thus check with np.correlate\n",
140140
"print(\" \", res)\n",
141-
"print(\" \", np.correlate(x, h, \"SAME\"))\n",
142-
"print(np.correlate(x, h, \"FULL\"))"
141+
"print(\" \", np.correlate(x, h, mode=\"same\"))\n",
142+
"print(np.correlate(x, h, mode=\"full\"))"
143143
]
144144
},
145145
{
@@ -168,8 +168,8 @@
168168
"# thus check with np.convolve\n",
169169
"print(\" \", res)\n",
170170
"print(\" \", np.array(tf.squeeze(tf.nn.convolution(data, kernel, 1, \"SAME\"))))\n",
171-
"print(\" \", np.convolve(x, h, mode=\"SAME\"))\n",
172-
"print(np.convolve(x, h, mode=\"FULL\"))"
171+
"print(\" \", np.convolve(x, h, mode=\"same\"))\n",
172+
"print(np.convolve(x, h, mode=\"full\"))"
173173
]
174174
},
175175
{
@@ -220,8 +220,8 @@
220220
"res = np.array(res)\n",
221221
"# thus check with np.correlate\n",
222222
"print(\" \", res)\n",
223-
"print(\" \", np.correlate(x, h, \"VALID\"))\n",
224-
"print(np.correlate(x, h, \"FULL\"))"
223+
"print(\" \", np.correlate(x, h, mode=\"valid\"))\n",
224+
"print(np.correlate(x, h, mode=\"full\"))"
225225
]
226226
},
227227
{
@@ -249,8 +249,8 @@
249249
"res = np.array(res)\n",
250250
"# thus check with np.convolve\n",
251251
"print(\" \", res)\n",
252-
"print(\" \", np.convolve(x, h, mode=\"VALID\"))\n",
253-
"print(np.convolve(x, h, mode=\"FULL\"))"
252+
"print(\" \", np.convolve(x, h, mode=\"valid\"))\n",
253+
"print(np.convolve(x, h, mode=\"full\"))"
254254
]
255255
},
256256
{
@@ -282,9 +282,9 @@
282282
],
283283
"metadata": {
284284
"kernelspec": {
285-
"display_name": "myddasp",
285+
"display_name": "data-driven-audio-signal-processing-exercise",
286286
"language": "python",
287-
"name": "myddasp"
287+
"name": "python3"
288288
},
289289
"language_info": {
290290
"codemirror_mode": {
@@ -296,7 +296,7 @@
296296
"name": "python",
297297
"nbconvert_exporter": "python",
298298
"pygments_lexer": "ipython3",
299-
"version": "3.10.6"
299+
"version": "3.13.7"
300300
}
301301
},
302302
"nbformat": 4,

0 commit comments

Comments
 (0)