Commit d0414aa7 authored by David Maxence's avatar David Maxence
Browse files

Ajout training nofold + base test google

parent 6d3affe3
{
"cells": [
{
"cell_type": "code",
"execution_count": 22,
"id": "israeli-hometown",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np \n",
"import os\n",
"import pandas as pd \n",
"from scipy.io import wavfile\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "waiting-today",
"metadata": {},
"outputs": [],
"source": [
"samplerate, data = wavfile.read('./7061-6-0-0.wav')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "computational-europe",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:absl:Lingvo does not support eager execution yet. Please disable eager execution with tf.compat.v1.disable_eager_execution() or proceed at your own risk.\n"
]
}
],
"source": [
"import leaf_audio.frontend as frontend\n",
"\n",
"leaf = frontend.Leaf()\n",
"melfbanks = frontend.MelFilterbanks()\n",
"tfbanks = frontend.TimeDomainFilterbanks()\n",
"sincnet = frontend.SincNet()\n",
"sincnet_plus = frontend.SincNetPlus()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "disciplinary-brain",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"numpy.ndarray"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(data)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "compound-diesel",
"metadata": {},
"outputs": [],
"source": [
"data = data.astype('float')"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "sustained-default",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dtype('float64')"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.dtype"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "developmental-lounge",
"metadata": {},
"outputs": [],
"source": [
"leaf_representation = leaf(data)\n",
"melfbanks_representation = melfbanks(data)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "fuzzy-helmet",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"tensorflow.python.framework.ops.EagerTensor"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(melfbanks_representation)"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "funny-emperor",
"metadata": {},
"outputs": [],
"source": [
"leaf_representation\n",
"t= melfbanks_representation.numpy"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "raising-stephen",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bound method _EagerTensorBase.numpy of <tf.Tensor: shape=(99225, 1, 40), dtype=float32, numpy=\n",
"array([[[-11.512925, -11.512925, -11.512925, ..., -11.512925,\n",
" -11.512925, -11.512925]],\n",
"\n",
" [[-11.512925, -11.512925, -11.512925, ..., -11.512925,\n",
" -11.512925, -11.512925]],\n",
"\n",
" [[-11.512925, -11.512925, -11.512925, ..., -11.512925,\n",
" -11.512925, -11.512925]],\n",
"\n",
" ...,\n",
"\n",
" [[-11.512925, -11.512925, -11.512925, ..., -11.512925,\n",
" -11.512925, -11.512925]],\n",
"\n",
" [[-11.512393, -11.512265, -11.512299, ..., -11.507828,\n",
" -11.507522, -11.507188]],\n",
"\n",
" [[-11.512925, -11.512925, -11.512925, ..., -11.512925,\n",
" -11.512925, -11.512925]]], dtype=float32)>>"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "dressed-present",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment