diff --git a/src/config.py b/src/config.py index 49a440a..4fa2ae9 100644 --- a/src/config.py +++ b/src/config.py @@ -4,14 +4,14 @@ code_path: str = '/repos/DCASE2021-Task1/src/' training_file: str = 'train_val_gammatone_mono_f1.h5' validation_file: str = 'train_val_gammatone_mono_f2.h5' -tf: bool = False +tf: bool = True # model parameters verbose: bool = True # [True, False] n_filters: list = [32, 64, 128] pools_size: list = [(1, 10), (1, 5), (1, 5)] dropouts_rate: list = [0.3, 0.3, 0.3] -binary_layer: bool = True +binary_layer: bool = False ratio: int = 2 pre_act: bool = False @@ -21,7 +21,7 @@ dense_layer = None dropouts_rate_cl = None -split_freqs: bool = True # [True, False] +split_freqs: bool = False # [True, False] n_split_freqs = 3 f_split_freqs = [64, 128] diff --git a/src/main.py b/src/main.py index 215775b..d7dcd48 100644 --- a/src/main.py +++ b/src/main.py @@ -88,11 +88,11 @@ callbacks = check_callbacks(config.home_path) if config.data_augmentation is not None: - history = model.fit_generator(train_datagen, - validation_data=(val_x, val_y), epochs=epochs, - steps_per_epoch=np.ceil((x.shape[0] - 1) / config.batch_size), - callbacks=callbacks, - verbose=tr_verbose) + history = model.fit(train_datagen, + validation_data=(val_x, val_y), epochs=epochs, + steps_per_epoch=np.ceil((x.shape[0] - 1) / config.batch_size), + callbacks=callbacks, + verbose=tr_verbose) else: history = model.fit(x, y, validation_data=(val_x, val_y), batch_size=config.batch_size, epochs=epochs, callbacks=callbacks, diff --git a/src/tests_variables.py b/src/tests_variables.py index b14ce73..ce91964 100644 --- a/src/tests_variables.py +++ b/src/tests_variables.py @@ -1,6 +1,6 @@ import config if config.tf: - from tensorflow.keras.callbacks import ModelCheckpoint, CSVLoggerç + from tensorflow.keras.callbacks import ModelCheckpoint, CSVLogger else: from keras.callbacks import ModelCheckpoint, CSVLogger diff --git a/tf1-15.yml b/tf1-15.yml deleted file mode 100644 index ba25876..0000000 --- a/tf1-15.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: tf1-15 -channels: - - anaconda - - conda-forge - - defaults -dependencies: - - _libgcc_mutex=0.1=main - - _tflow_select=2.1.0=gpu - - absl-py=0.11.0=py36h5fab9bb_0 - - astor=0.8.1=pyh9f0ad1d_0 - - c-ares=1.17.1=h36c2ea0_0 - - ca-certificates=2020.10.14=0 - - cached-property=1.5.1=py_0 - - certifi=2020.6.20=py36_0 - - cudatoolkit=10.0.130=0 - - cudnn=7.6.5=cuda10.0_0 - - cupti=10.0.130=0 - - cycler=0.10.0=py_2 - - dbus=1.13.6=he372182_0 - - dill=0.3.2=py_0 - - expat=2.2.9=he1b5a44_2 - - fontconfig=2.13.1=he4413a7_1000 - - freetype=2.10.4=h7ca028e_0 - - gast=0.2.2=py_0 - - glib=2.66.1=h92f7085_0 - - google-pasta=0.2.0=pyh8c360ce_0 - - grpcio=1.33.2=py36he0f7d3b_2 - - gst-plugins-base=1.14.0=hbbd80ab_1 - - gstreamer=1.14.0=hb31296c_0 - - h5py=2.10.0=py36hd6299e0_1 - - hdf5=1.10.6=nompi_h7c3c948_1111 - - icu=58.2=hf484d3e_1000 - - importlib-metadata=3.1.1=pyhd8ed1ab_0 - - jpeg=9d=h36c2ea0_0 - - keras=2.3.1=py36_0 - - keras-applications=1.0.8=py_1 - - keras-preprocessing=1.1.0=py_0 - - kiwisolver=1.3.1=py36h51d7077_0 - - krb5=1.17.2=h926e7f8_0 - - lcms2=2.11=hcbb858e_1 - - ld_impl_linux-64=2.33.1=h53a641e_7 - - libblas=3.9.0=3_openblas - - libcblas=3.9.0=3_openblas - - libcurl=7.71.1=hcdd3856_8 - - libedit=3.1.20191231=h14c3975_1 - - libev=4.33=h516909a_1 - - libffi=3.3=he6710b0_2 - - libgcc-ng=9.1.0=hdf63c60_0 - - libgfortran-ng=7.5.0=hae1eefd_17 - - libgfortran4=7.5.0=hae1eefd_17 - - libgpuarray=0.7.6=h14c3975_1003 - - liblapack=3.9.0=3_openblas - - libnghttp2=1.41.0=h8cfc5f6_2 - - libopenblas=0.3.12=pthreads_hb3c22a3_1 - - libpng=1.6.37=h21135ba_2 - - libprotobuf=3.13.0.1=h8b12597_0 - - libssh2=1.9.0=hab1572f_5 - - libstdcxx-ng=9.1.0=hdf63c60_0 - - libtiff=4.1.0=h4f3a223_6 - - libuuid=2.32.1=h14c3975_1000 - - libwebp-base=1.1.0=h36c2ea0_3 - - libxcb=1.13=h14c3975_1002 - - libxml2=2.9.10=hb55368b_3 - - lz4-c=1.9.2=he1b5a44_3 - - mako=1.1.3=pyh9f0ad1d_0 - - markdown=3.3.3=pyh9f0ad1d_0 - - markupsafe=1.1.1=py36he6145b8_2 - - matplotlib=3.3.3=py36h5fab9bb_0 - - matplotlib-base=3.3.3=py36he12231b_0 - - ncurses=6.2=he6710b0_1 - - numpy=1.19.4=py36h8732dcd_1 - - olefile=0.46=pyh9f0ad1d_1 - - openssl=1.1.1h=h7b6447c_0 - - opt_einsum=3.3.0=py_0 - - pcre=8.44=he1b5a44_0 - - pillow=8.0.1=py36h10ecd5c_0 - - pip=20.3=py36h06a4308_0 - - protobuf=3.13.0.1=py36h201607c_1 - - pthread-stubs=0.4=h36c2ea0_1001 - - pygpu=0.7.6=py36h68bb277_1002 - - pyparsing=2.4.7=pyh9f0ad1d_0 - - pyqt=5.9.2=py36hcca6a23_4 - - python=3.6.12=hcff3b4d_2 - - python-dateutil=2.8.1=py_0 - - python_abi=3.6=1_cp36m - - pyyaml=5.3.1=py36he6145b8_1 - - qt=5.9.7=h5867ecd_1 - - readline=8.0=h7b6447c_0 - - scipy=1.5.3=py36h976291a_0 - - setuptools=50.3.1=py36h06a4308_1 - - sip=4.19.8=py36hf484d3e_0 - - six=1.15.0=pyh9f0ad1d_0 - - sqlite=3.33.0=h62c20be_0 - - tensorboard=1.15.0=py36_0 - - tensorflow=1.15.0=gpu_py36h5a509aa_0 - - tensorflow-base=1.15.0=gpu_py36h9dcbed7_0 - - tensorflow-estimator=1.15.1=pyh2649769_0 - - tensorflow-gpu=1.15.0=h0d30ee6_0 - - termcolor=1.1.0=py_2 - - theano=0.9.0=py36_1 - - tk=8.6.10=hbc83047_0 - - tornado=6.1=py36h1d69622_0 - - werkzeug=0.16.1=py_0 - - wheel=0.35.1=pyhd3eb1b0_0 - - wrapt=1.12.1=py36h1d69622_2 - - xorg-libxau=1.0.9=h14c3975_0 - - xorg-libxdmcp=1.1.3=h516909a_0 - - xz=5.2.5=h7b6447c_0 - - yaml=0.2.5=h516909a_0 - - zipp=3.4.0=py_0 - - zlib=1.2.11=h7b6447c_3 - - zstd=1.4.5=h6597ccf_2 -prefix: /pathto/anaconda/anaconda3/envs/tf1-15 # change prefix path diff --git a/tf2.yml b/tf2.yml new file mode 100644 index 0000000..d1c5205 --- /dev/null +++ b/tf2.yml @@ -0,0 +1,161 @@ +name: tf2 +channels: + - anaconda + - conda-forge + - defaults +dependencies: + - _libgcc_mutex=0.1=main + - _tflow_select=2.1.0=gpu + - absl-py=0.11.0=py36h06a4308_0 + - aiohttp=3.6.3=py36h7b6447c_0 + - astunparse=1.6.3=py_0 + - async-timeout=3.0.1=py36_0 + - attrs=20.3.0=pyhd3eb1b0_0 + - blas=1.0=mkl + - blinker=1.4=py36_0 + - brotlipy=0.7.0=py36h27cfd23_1003 + - bzip2=1.0.8=h516909a_3 + - c-ares=1.17.1=h27cfd23_0 + - ca-certificates=2020.12.5=ha878542_0 + - cachetools=4.1.1=py_0 + - cairo=1.16.0=h18b612c_1001 + - certifi=2020.12.5=py36h5fab9bb_1 + - cffi=1.14.4=py36h261ae71_0 + - chardet=3.0.4=py36h06a4308_1003 + - click=7.1.2=py_0 + - cryptography=3.2.1=py36h3c74f83_1 + - cudatoolkit=10.1.243=h6bb024c_0 + - cudnn=7.6.5=cuda10.1_0 + - cupti=10.1.168=0 + - cycler=0.10.0=py_2 + - dbus=1.13.6=he372182_0 + - expat=2.2.9=he1b5a44_2 + - ffmpeg=4.1.3=h167e202_0 + - fontconfig=2.13.1=he4413a7_1000 + - freetype=2.10.4=h7ca028e_0 + - gast=0.3.3=py_0 + - giflib=5.2.1=h36c2ea0_2 + - glib=2.66.1=h92f7085_0 + - gmp=6.2.1=h58526e2_0 + - gnutls=3.6.13=h85f3911_1 + - google-auth=1.23.0=pyhd3eb1b0_0 + - google-auth-oauthlib=0.4.2=pyhd3eb1b0_2 + - google-pasta=0.2.0=py_0 + - graphite2=1.3.13=h58526e2_1001 + - grpcio=1.31.0=py36hf8bcb03_0 + - gst-plugins-base=1.14.0=hbbd80ab_1 + - gstreamer=1.14.0=hb31296c_0 + - h5py=2.10.0=nompi_py36h513d04c_102 + - harfbuzz=2.4.0=h37c48d4_1 + - hdf5=1.10.5=nompi_h3c11f04_1104 + - icu=58.2=hf484d3e_1000 + - idna=2.10=py_0 + - idna_ssl=1.1.0=py36_0 + - importlib-metadata=2.0.0=py_1 + - intel-openmp=2020.2=254 + - jasper=1.900.1=h07fcdf6_1006 + - jpeg=9d=h36c2ea0_0 + - keras=2.4.3=py_0 + - keras-applications=1.0.8=py_1 + - keras-preprocessing=1.1.0=py_1 + - kiwisolver=1.3.1=py36h51d7077_0 + - lame=3.100=h14c3975_1001 + - lcms2=2.11=hcbb858e_1 + - ld_impl_linux-64=2.33.1=h53a641e_7 + - libblas=3.8.0=21_mkl + - libcblas=3.8.0=21_mkl + - libedit=3.1.20191231=h14c3975_1 + - libffi=3.3=he6710b0_2 + - libgcc-ng=9.1.0=hdf63c60_0 + - libgfortran-ng=7.3.0=hdf63c60_0 + - libiconv=1.16=h516909a_0 + - liblapack=3.8.0=21_mkl + - liblapacke=3.8.0=21_mkl + - libpng=1.6.37=h21135ba_2 + - libprotobuf=3.13.0.1=hd408876_0 + - libstdcxx-ng=9.1.0=hdf63c60_0 + - libtiff=4.1.0=hc3755c2_3 + - libuuid=2.32.1=h14c3975_1000 + - libwebp=1.0.2=h56121f0_5 + - libxcb=1.13=h14c3975_1002 + - libxml2=2.9.10=hb55368b_3 + - lz4-c=1.9.2=he1b5a44_3 + - markdown=3.3.3=py36h06a4308_0 + - matplotlib=3.3.3=py36h5fab9bb_0 + - matplotlib-base=3.3.3=py36he12231b_0 + - mkl=2020.2=256 + - mkl-service=2.3.0=py36he904b0f_0 + - mkl_fft=1.2.0=py36h23d657b_0 + - mkl_random=1.1.1=py36h0573a6f_0 + - multidict=4.7.6=py36h7b6447c_1 + - ncurses=6.2=he6710b0_1 + - nettle=3.6=he412f7d_0 + - numpy=1.19.2=py36h54aff64_0 + - numpy-base=1.19.2=py36hfa32c7d_0 + - oauthlib=3.1.0=py_0 + - olefile=0.46=pyh9f0ad1d_1 + - opencv=4.1.1=py36ha799480_1 + - openh264=1.8.0=hdbcaa40_1000 + - openssl=1.1.1h=h516909a_0 + - opt_einsum=3.1.0=py_0 + - pcre=8.44=he1b5a44_0 + - pillow=8.0.0=py36h9a89aac_0 + - pip=20.3=py36h06a4308_0 + - pixman=0.38.0=h516909a_1003 + - protobuf=3.13.0.1=py36he6710b0_1 + - pthread-stubs=0.4=h36c2ea0_1001 + - pyasn1=0.4.8=py_0 + - pyasn1-modules=0.2.8=py_0 + - pycparser=2.20=py_2 + - pyjwt=1.7.1=py36_0 + - pyopenssl=20.0.0=pyhd3eb1b0_1 + - pyparsing=2.4.7=pyh9f0ad1d_0 + - pyqt=5.9.2=py36hcca6a23_4 + - pysocks=1.7.1=py36h06a4308_0 + - python=3.6.12=hcff3b4d_2 + - python-dateutil=2.8.1=py_0 + - python_abi=3.6=1_cp36m + - pyyaml=5.3.1=py36he6145b8_1 + - qt=5.9.7=h5867ecd_1 + - readline=8.0=h7b6447c_0 + - requests=2.25.0=pyhd3eb1b0_0 + - requests-oauthlib=1.3.0=py_0 + - rsa=4.6=py_0 + - scipy=1.5.2=py36h0b6359f_0 + - setuptools=50.3.1=py36h06a4308_1 + - sip=4.19.8=py36hf484d3e_0 + - six=1.15.0=py36h06a4308_0 + - sqlite=3.33.0=h62c20be_0 + - tensorboard=2.3.0=pyh4dce500_0 + - tensorboard-plugin-wit=1.6.0=py_0 + - tensorflow=2.2.0=gpu_py36hf933387_0 + - tensorflow-base=2.2.0=gpu_py36h8a81be8_0 + - tensorflow-estimator=2.2.0=pyh208ff02_0 + - tensorflow-gpu=2.2.0=h0d30ee6_0 + - termcolor=1.1.0=py36_1 + - tk=8.6.10=hbc83047_0 + - tornado=6.1=py36h1d69622_0 + - typing_extensions=3.7.4.3=py_0 + - urllib3=1.25.11=py_0 + - werkzeug=1.0.1=py_0 + - wheel=0.35.1=pyhd3eb1b0_0 + - wrapt=1.12.1=py36h7b6447c_1 + - x264=1!152.20180806=h14c3975_0 + - xorg-kbproto=1.0.7=h14c3975_1002 + - xorg-libice=1.0.10=h516909a_0 + - xorg-libsm=1.2.3=h84519dc_1000 + - xorg-libx11=1.6.12=h516909a_0 + - xorg-libxau=1.0.9=h14c3975_0 + - xorg-libxdmcp=1.1.3=h516909a_0 + - xorg-libxext=1.3.4=h516909a_0 + - xorg-libxrender=0.9.10=h516909a_1002 + - xorg-renderproto=0.11.1=h14c3975_1002 + - xorg-xextproto=7.3.0=h14c3975_1002 + - xorg-xproto=7.0.31=h14c3975_1007 + - xz=5.2.5=h7b6447c_0 + - yaml=0.2.5=h516909a_0 + - yarl=1.6.2=py36h7b6447c_0 + - zipp=3.4.0=pyhd3eb1b0_0 + - zlib=1.2.11=h7b6447c_3 + - zstd=1.4.5=h6597ccf_2 +prefix: /home/javi/anaconda3/envs/tf2