Wednesday, January 19, 2022

Choosing Journals and Conferences for Publication: Google Top 20 (and h5-index > 30)

If you want to publish your academic paper in a conference or journal, you may be confused about to which conference or journal you should submit your papers to. This short article may help you. To be categorized as a "reputable journal", my institution required two indicators below.

  1. It appears in Google Top 20 (all categories, categories, and sub-categories)
  2. It has Google H5-index > 30
For the first reason, it makes sense. The top twenty are the top 20 journals and conferences (mixed) which have the highest h5-index. I don't know the reason for the second reason why my institution chooses 30 as the limit of h5-index for "more incentive". It still makes sense since the higher h5-index means the higher impact.

From those two indicators, I choose the first as the main criteria for selecting publication. Here are five top 20 journals and conferences from all categories, categories, and two sub-categories in my field.


Google Top-20 (all categories)


For choosing categories, click "VIEW ALL"
https://scholar.google.com > Metrics > VIEW ALL.

Google Top 20 Category Engineering and Computer Sciences



Google Top 20 Category Life Sciences and Earth Sciences



Google Top 20 Sub-category: Signal Processing



Google Top 20 Sub-category: Acoustic and Audio



This guide for selecting criteria is not mandatory in my constitution. But they will give more bonus to the researchers if their publications are ranked by one or both criteria above (more bonus for both, maybe).

Tuesday, January 04, 2022

New Paper: Effect of Different Splitting Criteria on Speech Emotion Recognition

Abstract

Traditional speech emotion recognition (SER) evaluations have been performed merely on a speaker-independent (SI) condition; some of them even did not evaluate their result on this condition (speaker-dependent, SD). This paper highlights the importance of splitting training and test data for SER by script, known as sentence-open or text-independent (TI) criteria. The results show that employing sentence-open criteria degraded the performance of SER. This finding implies the difficulties of recognizing emotion from speech in different linguistic information embedded in acoustic information. Surprisingly, text-independent criteria consistently performed worse than speaker+text-independent (STI) criteria. The full order of difficulties for splitting criteria on SER performances from the most difficult to the easiest is text- independent, speaker+text-independent, speaker-independent, and speaker+text-dependent. The gap between speaker+text- independent and text-independent was smaller than other criteria, strengthening the difficulties of recognizing emotion from speech in different sentences.


Method

Experiment #1: average of 30 trials (runs)
Experiment #2: 5-fold cross-validation
Experiment #3: Same number of training and test data


Result


Take home message

Sentence (or linguistic) information plays a crucial role in speech emotion recognition.


Full paper + code:

https://github.com/bagustris/ti

Thursday, December 23, 2021

New Paper: Speech Naturalness Recognition

Abstract

This study proposes an automatic naturalness recognition from an acted dialogue. The problem can be stated that: given speech utterances with their naturalness labels, is it possible to recognize these labels automatically? By what methods? And how to evaluate these methods? We evaluated two supervised classifiers to investigate the possibility of recognizing naturalness automatically in acted speech: long short-term memory and multilayer perceptron neural networks. These classifiers accept inputs in the form of acoustic features from a speech dataset. Two kinds of acoustic features were evaluated: low-level and high-level features. This initial study on automatic naturalness recognition of speech resulted in a moderate performance of the assessed systems. We measured the performance in concordance correlation coefficients, Pearson correlation coefficients, and root mean square errors. This study opens a potential application of speech processing techniques for measuring naturalness in acted dialogue, which benefits for drama- or movie-making in the future.

Illustration (of potential application):



(best) Result

Metric: concordance + Pearson correlation coefficient (CCC, PCC), [root] mean square error ([R]MSE)
Method; Multilayer perceptron (MLP) with high-level statistical functions (HSF)
Interpretation: intermediate result (CCC)



Full paper + Code

Wednesday, October 27, 2021

Benchmarking SSD: Micron 5300

This is a benchmark report for the biggest size ever SSD I used, two 8TB Micron 5300. For simplicity, I only conducted a benchmark on a single disk with XFS and EXT4 filesystem.

Name: Micron 5300 MTFD

Capacity: 8 TB (7.7TB)

Link: https://www.micron.com/products/ssd/product-lines/5300

Other specs:


Result

EXT4


XFS


(Partial) conclusion

XFS filesystem seems faster (531 MBps read) and more stable than EXT4.

Thursday, October 21, 2021

Argumen "self" pada Python OOP (temasuk __init__ dan instance variable)

Saat pertama kali mengetahui banyaknya kata "self" pada bahasa pemrograman Python, saya terhenyak. Teknik ini banyak sekali dipakai (a must!), dan saya sama sekali tidak memahaminya. Dua tahun lebih berlalu sejak saya ingin mengenal "self" pada Python (2019-02-02), dan kali ini saya ingin serius berkenalan dengannya.

"Kelas" dan OOP

Bahasa pemrograman python diadopsi secara meluas karena keluwesannya, baik secara prosedural maupun object-oriented programming (OOP). Pada kasus pertama, yakni prosedural, cukup sederhana dan intuitif. Misal:

def kali(x, y):
    return x*y

Secara singkat kita bisa paham bahwa "kali" adalah sebuah fungsi untuk mengalikan dua variabel, x dan y. Hal ini berbeda dengan kelas berikut

class kaliX (object):
    def __init__(self, data):
        self.data = int(data)
    def kali(self, other):
        return self.data * other.data
Disinilah saya kebingungan memahami apa itu self. Kembali ke dua potongan kode di atas. Kalau kita run di IPython, akan terlihat hasilnya sama sebagai berikut (hanya terlihat ketika mengakses blog ini via PC).



Jadi apa itu self?

Sebelum masuk ke self, kita masuk ke __init__ dulu karena __init__ disebut lebih dulu pada OOP, pada contoh di atas. __init__ adalah inititalization method pada badan OOP atau kelas. Fungsi pertama kelas ini, yakni didefinisikand dengan def __init__ akan dipanggil setiap instance dari kelas dibuat. Instance sederhananya ya kelas itu sendiri. Nah self adalah variabel pertama dari fungsi __init__. Variabel kedua fungsi __init__ adalah `data`. Berbeda dengan bahasa pemrograman lain (yang saya juga tidak mengerti), Python mengizinkan satu __init__ saja pada satu kelas [3].


Instance Variable

Sebagai tambahan dari self dan __init__ adalah `instance variable`. Instance variable adalah DASAR dari OOP dalam Python. Dalam contoh kelas "kaliX" di atas, instance variable-nya adalah sebagai berikut: `data` pada `self.data`. Maknanya, variabel data sebagai input kelas kaliX akan diubah menjadi integer dan menempati tempat `data` pada `self.data`. Pada fungsi `kali` yang menjadi bagian dari kelas `kaliX`, variabel `other` akan menempati `data` pada `other.data` melalui fungsi __init__ tadi. Begitu seterusnya jika ada variabel lain. Beginilah secara sederhana OOP bekerja. Instance variable bisa diisi secara eksplisit lewat `Namakelas.NamaInstanceVariable  = <nilai>`. Misalnya `my_circle.radius = 5` pada contoh berikut.

>>> class Circle:
         def __init__(self):
             self.radius = 1
    
>>> my_circle = Circle()
>>> print(my_circle.radius)
>>> 1
>>> my_circle.radius = 5
>>> print(my_circle.radius)
>>> 5


Kesimpulan

Telah dikelaskan apa itu __init__  -- sebagai fungsi initial di kelas --, self --sebagai argumen pertama __init__ --, dan instance variable -- sebagai dasar OOP di Python --.


Referensi:

  1. https://www.programiz.com/article/python-self-why
  2. https://www.digitalocean.com/community/tutorials/how-to-construct-classes-and-define-objects-in-python-3
  3. Naomi Ceder, The Quick Python Book, 2nd ed. Manning Publishing, 2018.

Thursday, October 14, 2021

Benchmarking HDD: HGST (G-Tech) vs. Seagate

Sebelum membaca artikel ini ada baiknya membaca benchmark saya sebelumnya, HDD vs SSD.

HDD 1: G-Technology 0G06071

Link: Amazon Japan

Spec


Hasil

Ext4


NTFS


HDD2: Seagate Expansion 5 TB

Link: Amazon Japan

Spec


Hasil

NTFS


Kesimpulan:

  • Ekstensi Ext4 secara umum lebih cepat (read rate) dan lebih stabil (kurva flat) daripada NTFS
  • HGST lebih cepat daripada Seagate (?)

Tuesday, October 12, 2021

Data Hiking 2020 - 2021

Data berikut merupakan ringkasan aktivitas pendakian saya satu tahun (2020-2021) yang diambil dari yamap. Untuk apa data ini? Untuk dokumentasi saya pribadi dan juga sebagai data pembanding dikemudian hari. 

Data Jumlah Gunung

Data jarak (km) per bulan

Data elevasi gain per bulan

Data jumlah hari pendakian per bulan

Data kalori per bulan

Lokasi pendakian (warna biru)


Ringkasan 

Terakhir adalah ringkasan aktivitas pendakian setahun. Bulan September 2020 dan Augustus 2021 saya tidak melakukan aktivitas pendakian.

Tuesday, October 05, 2021

Installing Tensorflow 1.15 in RTX3090 with GPU support

This note also reported a configuration that enables multiple Cuda version installations in a single OS.

RTX 3090 with Cuda 11 is new (in the time of writing, 2021) but Tensorflow 1.15 is old. These two kinds of software aren't compatible with each other since software development usually follows the latest updates. Hence it is cumbersome to install Tensorflow 1.15 in the new Cuda and GPU version. Why still use TF 1.15? Some of my research, particularly with multi outputs scenarios, aren't working well in TF2. Instead, it works smoothly in TF1. Here is how I installed TF1.15 with GPU support on the new Cuda 11 with RTX 3090.

Before going into the installation process, here is the result that I have at the end; it shows my hardware.
In[1]: import tensorflow as tf
In [2]: tf.__version__
Out[2]: '1.15.4'

In[3]: tf.test.is_gpu_available()
...
2021-10-05 11:47:26.465074: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1351] Created TensorFlow device (/device:GPU:0 with 22362 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:c1:00.0, compute capability: 8.6)
2021-10-05 11:47:26.469313: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x558ebc9d6310 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2021-10-05 11:47:26.469331: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): NVIDIA GeForce RTX 3090, Compute Capability 8.6
Out[3]: True

In this setup, I used python 3.7. You can change it accordingly.
# install appropriate conda, mine is Python 3.7, Linux
# see: https://docs.conda.io/en/latest/miniconda.html
wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh
chmod +x 
./Miniconda3-py37_4.10.3-Linux-x86_64.sh

conda create --name TF1.15 python=3.7
conda activate TF1.15

pip install nvidia-pyindex
pip install nvidia-tensorflow[horovod]
pip install pytz

conda install -c conda-forge openmpi
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/miniconda3/envs/TF1.15/lib/
Additional installation is needed from the OS side
 sudo apt install openmpi-bin
Finally, if you already installed cuda version 10 or 11 in your Ubuntu OS (installed in the system), it will not interfere with that installation since it is installed in (conda) virtual environment. It means that we have multiple cuda versions in a single OS.

In the end, using supercomputers like abci.ai will make life easier. No additional setup is needed, just use `module load`. But we need to pay even though we are employed by the same organization that operates the supercomputer.


Update 2022/03/28:  
I managed cannot install nvidia-tensorlow[horovod] via conda today. Instead, the following works.
conda create --name tensorflow-15 \
    tensorflow-gpu=1.15 \
    cudatoolkit=10.0 \
    cudnn=7.6 \
    python=3.6 \
    pip=20.0

Update 2022/03/29:

The aforementioned steps above now failed again due to a problem with the libclublas library. Although no error has been shown on the call of `tf.test.gpu_is_available()`, I faced an error when running code with TF 1.15. As a solution, I used docker as explained here (In the Indonesian language, right-click >> translate to English, if you use Chrome as a browser): 

Thursday, September 23, 2021

Gagal S3 karena tidak mau menyerahkan buku disertasi

Cerita berikut konyol namun menurut saya salah satu contoh idealisme terbaik. 

Dennis W. Ritchie, penemu bahasa C dan Unix gagal S3 karena tidak mau menyerahkan buku disertasinya ke perpustakaan Harvard University. Si penemu bahasa C tersebut sudah menyelesaikan semuanya tentang disertasinya, buku pun sudah, ujian juga sudah. Cuma satu, saat perpustakaan Harvard meminta buku disertasinya, dia menolaknya. Dia berujar, "Jika perpus mau disertasiku, ya beli...."


‘If the Harvard library wants a bound copy for them to keep, they should pay for the book, because I’m not going to!’


Tidak ada Ritchie artinya (mungkin) tidak ada Unix dan Bahasa C. Tidak ada Unix artinya tidak ada Linux, Windows, MacOS, dan Android, atau mungkin ada namun tidak secanggih sekarang. Di zaman yang modern ini, kita perlu menjaga idealisme hal-hal kecil seperti diatas. Logis sekali pernyataan Dennis Ritchie ini: Jika engkau menginginkan suatu barang, engkau harus membelinya.


Ketikan yang sempurna

Tambahan kecil di cerita disertasi Dennis Ritchie adalah ketikan yang mendekati sempurna. Di zaman yang belum ada komputer (dan dia sendiri yang menemukan/membangun komputer), hanya ada enam kesalahan tik dalam disertasinya. Padahal disertasinya sendiri berkaitan dengan matematika. Sangat sulit untuk membuat persamaan matematika yang sempurna dengan mesin tik. Saya mengalaminya saat SMP. Gambar di bawah adalah contoh ketikan disertasi Ritchie dari sumber [1].

Disertasi Ritchie, hanya 6 salah tik (typo) dalam 181 halaman [1]


Referensi:

[1] https://computerhistory.org/blog/discovering-dennis-ritchies-lost-dissertation/ 


Wednesday, September 22, 2021

Lebih baik mengundurkan diri daripada menginstall WA

Seorang teman berseloroh: dia lebih memilih untuk dipecat/mengundurkan diri dari pekerjaannya daripada diminta menginstall whatsapp (WA). Dan dia melakukannya. Dia mengundurkan dari posisi dosen PTN di wilayah barat Indonesia. Saya sependapat dengannya. 

Hidup ini pilihan, dan kadang tidak ada pilihan yang salah (dan selebihnya ada, salah memilih). Menjadi dosen itu pilihan baik, pekerjaan lain juga pilihan baik. Teman saya yang mundur gara-gara WA tadi juga tidak salah karena itu pilihannya. Pihak kampus yang memaksa teman saya menginstall WA tadi juga tidak salah karena itu wewenangnya. 

Ketika sudah bekerja kita harus mematuhi peraturan pekerjaan. Jika tidak bisa maka kita harus mundur, itulah konsekuensinya. Mundur juga bukan perbuatan tercela. Hal ini akan berbeda ketika kita bisa merubah kebijakan atau peraturan itu. 

Wallahua'lam bi showab.

Tulisan terkait:

Friday, September 10, 2021

Setting Up Huion WH1409 V2 on Ubuntu (20.04)

This is my second experience using a pen tablet on Ubuntu (which works wonderful). Everything works out the box using the previous Digimend v10 installation. The only change I made is to copy Huion H950p configuration to the following content.
#!/bin/sh
# huiowh1409.sh: configuration file for WH1409 on Ubuntu 20.04, run as: $ ./huionwh1409.sh

#Change DVI-I-1 to what monitor you want from running command: xrandr
MONITOR="DP-1"

# Get pad name, use "lsusb" or "xsetwacom list devices"
PAD_NAME='HUION Huion Tablet'

# get stylus ID
ID_STYLUS=$(xinput | grep "$PAD_NAME stylus" | cut -f 2 | cut -c 4-5)

# map pad to first monitor
xinput map-to-output $ID_STYLUS $MONITOR

# Pad button mapping for Xournal

xsetwacom set "$PAD_NAME Pad pad" button 1 key Ctrl z # undo
xsetwacom set "$PAD_NAME Pad pad" button 2 key Ctrl y # redo
xsetwacom set "$PAD_NAME Pad pad" button 3 key Ctrl shift d # default
xsetwacom set "$PAD_NAME Pad pad" button 8 key Ctrl shift p # pen

xsetwacom set "$PAD_NAME Pad pad" button 9 key Ctrl shift e # eraser
xsetwacom set "$PAD_NAME Pad pad" button 10 key Ctrl 1 # shape recognizer
xsetwacom set "$PAD_NAME Pad pad" button 11 key Ctrl 4 # arrow
xsetwacom set "$PAD_NAME Pad pad" button 12 key Ctrl 5 # coordinate

xsetwacom set "$PAD_NAME Pad pad" button 13 key Ctrl c # copy
xsetwacom set "$PAD_NAME Pad pad" button 14 key Ctrl v # paste
xsetwacom set "$PAD_NAME Pad pad" button 15 key Ctrl shift r # select rect 
xsetwacom set "$PAD_NAME Pad pad" button 16 key Ctrl d # new page after


exit 0
All 12 pad buttons work without any further configuration! Both USB cable and bluetooth connection also work seamlessly. This WH1409 tablet has a smoother pen (PW500 pen) compared to H950P (with PW100 pen). So far, I am very satisifed by its performance, particularly on Linux-based PC.

Wednesday, September 08, 2021

Etika Komunikasi Mahasiswa Terhadap Dosen

Berdasarkan Peraturan Rektor ITS No 15 Tahun 2019, berikut adalah tangkapan layar "Etika Mahasiswa Terhadap Dosen" yang diambil dari sumber aslinya [1].

Dalam artikel ini, saya ingin menggaris bawahi etika komunikasi mahasiswa terhadap dosen seperti tercantum pada poin C. Satu kata untuk menggambarkan etika mahasiswa terhadap dosen adalah "santun".

Arti santun menurut KBBI

san.tun:

  1. (adjektiva) halus dan baik (budi bahasanya, tingkah lakunya); sabar dan tenang; sopan
  2. (adjektiva) penuh rasa belas kasihan; suka menolong

Arti santun menurut saya

Santun menurut saya harus mencakup setidaknya tiga hal berikut:

  1. Menggunakan jalur dan bahasa resmi.
  2. Jalur resmi: Telfon, email kampus, dan SMS (bukan WA, facebook)
    Bahasa resmi: Bahasa Indonesia (bukan jawa, Inggris)
  3. Mengkonfirmasi segala percakapan dan instruksi
  4. Contoh:
    Dosen: Gunakan metode A dan laporkan hasilnya minggu depan senin 30 Agustus 2021
    Mahasiswa: Baik Bapak, saya akan melakukan metode A dan melaporkan hasilnya senin 30 Agustus 2021
  5. Memperhatikan waktu komunikasi, termasuk segera membalasnya jika butuh balasan
  6. Butuh balasan ditandakan dengan: kalimat tanya, perintah, permohonan, dll.

Perkecualian untuk kasus-kasus di atas tentunya dengan seizin dosen dan kedua belah pihak. Misalnya dosen telah mengizinkan mahasiswa untuk mengontaknya via (Facebook) messenger atau (Google) chat.

Khusus saya

Cara terbaik mengontak saya adalah dengan email. Waktu tidak masalah bagi saya. Anda bisa mengirim email ke saya kapan saja. Orang terbaik menurut saya adalah orang yang paling cepat membalas email.

Penutup

Panduan ini tidak hanya berlaku untuk mahasiswa-dosen, bisa diaplikasikan pada kasus lainnya.

Referensi: 

[1] https://www.its.ac.id/ppid/wp-content/uploads/sites/68/2021/02/15.-Peraturan-Rektor-Nomor-15-Tahun-2019-ttg-Kode-Etik-Mahasiswa.pdf

Monday, September 06, 2021

Mengundurkan Diri Itu Bukan Perbuatan Tercela

Saat saya bekerja di pabrik dulu, suatu kali pernah (ibu) sekretaris perusahaan mengundurkan diri. Ceritanya begini. Saat permintaan barang sedang tinggi-tingginya, Pak Direktur (aka sachou) meminta bu sekretaris ikut bekerja di lapangan (genba a.k.a. pabrik). Besoknya si ibu sekretaris langsung minta mengundurkan diri untuk bulan depannya. Alasannya sederhana: dia melamar kerja untuk pekerjaan administrasi, bukan untuk pekerjaan lapangan (genba).

Mirip dengan cerita di atas. Suatu ketika seorang adik kelas melamar  pekerjaan dosen di suatu perguruan tinggi. Setelah diterima, dia komplain karena diminta oleh kepala jurusan (kajur) untuk mengerjakan pekerjaan administrasi. Tak lama kemudian dia mengundurkan diri. Alasannya sederhana: dia melamar pekerjaan dosen, menjadi pengajar dan peneliti, bukan menjadi staf administrasi.

Dalam dua kasus di atas, hampir tidak ada pihak yang salah. Pak direktur mempekerjakan ibu sekretaris karena kekurangan tenaga kerja di lapangan. Di kasus kedua, Pak Kajur juga kekurangan tenaga administrasi (yang terampil) sehingga mempekerjakan dosen untuk pekerjaan administrasi. Dari kedua kasus, baik bu sekretaris maupun teman dosen sama sekali tidak salah. Juga, mereka sulit menolak pekerjaan yang bukan bidangnya karena statusnya sebagai karyawan pada tempat mereka bekerja. Mundur menjadi pilihan terbaik bagi keduanya.

Mundur juga bisa menjadi alasan yang logis ketika tidak setuju dengan suatu hal, misalnya ketika diharuskan untuk menginstall whatsapp (WA) untuk urusan kerja. Sangat tidak logis dan tidak etis menggunakan WA untuk urusan pekerjaan. Seorang teman pernah berujar, hari dimana dia diminta menginstall WA oleh atasannya, hari itu juga dia akan mengundurkan diri. Penggunaan WA dan sejenisnya di kantor saya sekarang ini dilarang, dan bisa fatal akibatnya bila ketahuan menggunakan aplikasi tsb di kantor.

Mengundurkan diri itu bukan perbuatan tercela. Perbuatan tercela itu seperti korupsi

Monday, August 30, 2021

Kenapa Harus Berlari...

Saat kerja di Jepang, saya sering dipanggil oleh Pak Bos. Saat awal-awal di panggil, saya mendatanginya dengan berjalan. Pak Bos menyuruh saya berlari. Kalau berjalan saya butuh 1 menit, dengan berlari saya hanya butuh 30 detik. Kalau dalam sehari saya dipanggil 30 kali, maka saya bisa hemat 30 x 30 detik, 900 detik alias 15 menit. Dengan asumsi kerja 20 hari per bulan, saya bisa menghemat 15 x 20 menit alias 300 menit alias 5 jam per bulan. Waktu tsb bisa saya gunakan untuk pekerjaan lainnya. Kenapa harus berlari? Ya karena berlari mempercepat pekerjaan dan menunjukkan semangat kita.

Dalam tulisan saya yang lain: What we can do in 10 minutes, orang lain bisa mentransformasikan ide menjadi "produk" dalam 10 menit. Diberikan waktu 300 menit akan menghasilkan 10 ide  --> 10 produk, untuk orang tersebut.

Ayo berlari...!

Monday, August 23, 2021

How-to: Install jedi-vim in python 2.7

Rationale:

  • Although nowadays python3 becomes standard, in some servers the default python is still python2.7 (mostly RHEL servers).
  • Using vim (or emacs) in remote works is a must. You may use GUI, but the setup is more complicated than CLI.
  • Using vim without plugins is hard. We should use a minimum number of plugins. The most important plugin is code completion.
  • Humans make errors inevitably. Code completion prevents typos.

Based on those rationales, this is one line command to install jedi-vim (including jedi itself!) in python 2.7.

git clone --recursive https://github.com/davidhalter/jedi-vim.git --branch 0.9.0 ~/.vim/bundle/jedi-vim
Note: you need to install vim-pathogen first to allow plugin installation via "bundle" directory.

Thursday, August 19, 2021

Kenapa Harus Meng-CC email ke Diri Sendiri

Salah satu budaya "aneh" orang Jepang yang akhir-akhir ini mulai saya tiru adalah meng-cc email ke diri sendiri.

Saat awal datang ke Jepang, saya merasa aneh saja ada orang mengemail ditujukan (CC, carbon copy) ke diri sendiri. Professor saya melakukannya. Professor-professor lain pun ternyata juga sama. Saat itu professor saya meminta saya meng-CC email ke diri saya setiap kali mengemail beliau, namun saya jarang melakukannya. Sepuluh tahun berlalu, kini kebiasaan itu menjadi wajib bagi saya.

Kenapa harus meng-cc email ke diri sendiri?

Agar kita tahu, apakah email kita sampai atau tidak. Seseorang mungkin akan berargumen, kalau tidak sampai pasti ada notifikasi. Bisa jadi benar, tapi bisa jadi tidak semua email provider memberikan notifikasi jika ada email yang bouncing (tidak terkirim karena alasan teknis, misal alamat tidak tersedia, atau email tujuan penuh, atau alasan yang lain). Kalaupun toh pasti ada notifikasi jika tidak terkirim, tetap kita dapat mengambil manfaat, yakni lamanya waktu pengiriman. Alih-alih mengirim email dua kali (ganda), kita bisa mengecek apakah email yang kita kirim sudah diterima atau belum.

Monday, August 16, 2021

Install sox locally in cluster without root

This time, I can't install homebrew in (AIST) cluster as I previously did in JAIST cluster. Here are steps to documents how to install SoX, one of the most important library in sound processing, locally in cluster. I tried these steps in abci.ai.

# download sox package, in this case
wget https://nchc.dl.sourceforge.net/project/sox/sox/14.4.2/sox-14.4.2.tar.gz

# extract sox package
tar xvfz sox-14.4.2.tar.gz

# change to extracted sox directory
cd sox-14.4.2

# configure in local directory, I used $HOME
./configure --prefix=$HOME

# make
make

# make install
make install
Then check it by its version
[user13432@es2 ~]$ sox --version
sox:      SoX v14.4.2
You may also need to update $PATH to make it works in your enviroment.

Wednesday, August 11, 2021

Kenapa Harus Email, bukan WA

TL;DR: Kalau saya jadi CE0, dan ada karyawan saya yang menggunakan WA untuk urusan kerja, akan saya pecat saat itu juga... :D

Pada tulisan ini saya berargumen bahwa komunikasi untuk urusan pekerjaan seharusnya (dan umumnya) dilakukan menggunakan email, bukan WA (WhatsApp), messenger, chat dan sejenisnya. Di tempat kerja saya kebetulan tidak ada yang memakai WA; LINE kabarnya juga sudah dilarang sejak beberapa tahun yang lalu. Sebagai tambahan, penggunaan aplikasi zoom juga dilarang karena faktor keamanan.

Sebelum membaca tulisan ini ada baiknya anda membaca tulisan berikut: WA: Pemborosan Waktu..?

Kenapa harus menggunakan Email: 

  1. Terekam, recorded
  2. Salah satu fitur email yang paling powerful adalah "terekam". Apa isi email, kapan terkirim, dari siapa, ke siapa, semua ada. Bahkan email pertama yang saya buat waktu SMP masih bisa saya baca sampai sekarang. WA? Bisa! Tapi saya tidak tahu apa isi WA pertama saya. Anda tentu paham maksud saya, dua-duanya memiliki fitur terekam, tapi bak langit dan bumi.
  3. Searchable, ketercarian
  4. Fitur kedua yang amat saya sukai dari email: ketercarian. Data teks adalah data yang sangat kompleks tapi fleksibel. Kita bisa mencari apa saja yang pernah masuk ke email kita. WA? Bisa juga, selama belum dihapus, belum ganti hape, dan belum ganti nomor.
  5. Per topik
  6. Pentingnya menggunakan email adalah bisa berdiskusi per topik. Ada yang  mengirim email dengan subjek tertentu dan kita balas (Re:XXX). Berapapun panjang dan lama diskusi tersebut tidak masalah. Ini akan menjadi masalah dengan WA dengan layar kecil, ketercarian dan rekaman yang terbatas.
  7. Universal
  8. Email itu universal dan cross-platform, tidak di monopoli oleh perusahaan tertentu. Anda pakai yahoo, saya pakai gmail, tidak menjadi masalah, masih bisa berkirim email. Beda dengan WA, LINE, messenger, dan sejenisnya yang hanya berjalan pada platform yang sama.
  9. Email menempel pada akun, bukan nomor HP
  10. Kelebihan email selanjutnya adalah bahwa dia adalah akun independen, tidak menempel pada nomor HP. Nomor HP bisa digunakan untuk pengamanan ganda. Berbeda dengan WA yang menempel pada nomer HP. Jika ganti nomor kita harus mentransfer akun WA ke nomor baru. Jika tidak, by default, prinsipnya, ganti nomor ganti WA.

Itulah beberapa alasan kenapa harus menggunakan email untuk komunikasi tulisan dalam urusan pekerjaan. Lebih khusus lagi, kita seharusnya menggunakan email kerja (kantor) untuk urusan pekerjaan, bukan email personal atau individu. Tempat kita bekerja menyediakan email kantor untuk urusan pekerjaan (tidak berlaku jika kantor tidak menyediakan). Sampai sekarang pun saya tidak tahu email lain atasan saya selain email kantor (dan Slack!).

Semoga semakin banyak orang yang "hijrah" dan "bertobat" setelah membaca tulisan ini: tidak memakai WA lagi.

Jika tidak setuju dengan argumen saya ini, tulis alasan anda dan beritahu saya (setidaknya URLnya) melalui komen di bawah ini.

Wednesday, August 04, 2021

Extracting Emobase Feature Using Python-Opensmile under Windows (WSL)

This article documents my steps to extract acoustic features with "emobase" configuration on opensmile-python under Windows. I used WSL (Window Sub-System for Linux) with Ubuntu Latest (20.04). Click each image for larger size and clarity.

0. Windows Version

Here is my Windows version in which I experimented with. Other versions may give errors. To show your version, simply press the Windows button and type "about PC".
Edition	        Windows 10 Pro
Version	        20H2
Installed on	‎4/‎2/‎2021
OS build        19042.1083
Experience      Windows Feature Experience Pack 120.2212.3530.0

1. Activate WSL2

Here are the steps to activate WSL2 on Windows 10. WSL2 only works on Windows 10 version 1903 or higher, with Build 18362 or higher. For the older version, you can use WSL instead of WSL2.
a. Activate WSL using PowerShell. Press the Windows key, and enter the following.
 dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 
b. Install Linux kernel update package. Download from here.
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
Double click and install that .msi package.
Select WSL2 as default.
 wsl --set-default-version 2 

You need to ensure the wsl version after installing Ubuntu distro below.

2. Install Ubuntu

Press windows key and type "Microsoft Store". I choose Ubuntu (latest) instead of Ubuntu 20.04 or other versions. See image below; I already installed it.


Ensure that Ubuntu uses WSL2 as default. Check-in PowerShell with the following command (wsl -l -v).

Then click launch Ubuntu from the previous image/step, or you can type "Ubuntu" di search dash.
When launching Ubuntu for the first time, you will be prompted for the user name and password. Remember this credential. See the image below for example.

3. Install Python and pip

In Ubuntu do/type
 sudo apt update && sudo apt -y upgrade 
Enter your password. Type "y" when it is prompted.
Install Python using apt. I chose python3.7 as follows.
 sudo apt install python3.7-full 
Type "y" when it asked. See the image below for reference.

Test if the installation is successful. Type "python3.7" in Ubuntu to enter python3.7 console.

Next, we need pip to install python packages. Hence, we need to install pip first as follows.
 python3.7 -m ensurepip --upgrade 

4. Install Python-Opensmile

Since this version of python in Ubuntu is already equipped with pip, we can directly use it to install opensmile.
 python3.7 -m pip install opensmile 
See the image below for a reference.

Same as previous step, I installed IPython for my convenience. You may also need to install numpy, scipy, and matplotlib.
 python3.7 -m pip install ipython numpy scipy audb

We also need to install sox since it is required by opensmile
 sudo apt install sox 

5. Extract Emobase Feature

Now is the time to use opensmile. First, open IPython console for this python3.7.
 python3.7 -m IPython 
Import Opensmile and download emodb dataset with a specific configuration.
See the image below for your reference. Skip the parts with red cross since they contain errors (I forgot to add a comma between arguments).

Configure opensmile to extract EMOBASE feature.
smile = opensmile.Smile(
    feature_set=opensmile.FeatureSet.emobase,
    feature_level=opensmile.FeatureLevel.Functionals,
)
smile.feature_names
See image below for your reference. You can change feature_level value to "opensmile.FeatureLevel.LowLevelDescriptors" if you want LLD (LowLevelDescriptors, extracted per frame) instead of functionals (statistics of LLD). The number of emobase functional is 988 features [len(smile.features_names)].

Finally, we extract acoustic features based on these configuration.
smile.process_signal(
    signal,
    sampling_rate
)
See below image for your reference.


That's all. Usually, I save the extracted acoustic features in other format like numpy .npy files or .csv files. From my experience, this is my first extraction of emobase feature set. Previously I used gemaps, egemaps, compare2016, and emo_large configuration. Let see if this kind of feature set has advantages over others. Although intended for Windows 10, this configuration may also works for other distribution. Still, I prefer to use Ubuntu since the process is simple and straightforward. No need to set WSL2 and other things just pip and pip.

The full script to extract emobase functional features from all utterances in emodb dataset is given below. Please note that it takes a long time to process since it will download all utterances in emodb dataset according to "audb" format and extract acoustic features from them.

Example 1: Extract emobase feature from an excerpt of emodb dataset and save it as an .npy file.

import os
import time

import numpy as np
import pandas as pd

import audb
import audiofile
import opensmile

sr = 16000

# if you change code below, it will download the dataset again 
db = audb.load(
    'emodb',
    version='1.1.1',
    format='wav',
    mixdown=True,
    sampling_rate=sr,
    full_path=False,
    verbose=True,
)

smile = opensmile.Smile(
    feature_set=opensmile.FeatureSet.emobase,
    feature_level=opensmile.FeatureLevel.Functionals,
)

# If you run this program for the second time
# comment the whole db above and change db.root and db.files to (uncomment)
# db_root = audb.cached().index[0]
# db_files = pd.read_csv('/home/bagus/audb/emodb/1.1.1/fe182b91/db.files.csv')['file']

feats = []
for i in db.files:
    file = os.path.join(db.root, db.files[i])
    signal, _ = audiofile.read(
            file,
            always_2d=True,
            )
    feat = smile.process_signal(
            signal,
            sr
            )
    feats.append(feat.to_numpy().reshape(-1))

# this will save all emodb emobase feature in a single npy file
# make sure you have 'data' dir first
np.save('data/emodb_emobase.npy', feats)
  

Example 2: Extract emobase features from files under a directory ("ang") and save it in a csv file.
import os
import opensmile
import numpy as np
import glob
#from scipy.io import wavfile

# jtes angry path, 50 files
data_path ="/data/jtes_v1.1/wav/f01/ang/"
files = glob.glob(os.path.join(data_path, "*.wav"))
files.sort()

# initiate opensmile with emobase feature set
smile = opensmile.Smile(
    feature_set=opensmile.FeatureSet.emobase,
    feature_level=opensmile.FeatureLevel.Functionals,
)
smile.feature_names

# read wav files and extract emobase features on that file
feat = []

for file in files:
    print("processing file ... ", file)
    #sr, data = wavfile.read(file)
    #feat_i = smile.process_signal(data, sr)
    feat_i = smile.process_file(file)
    feat.append(feat_i.to_numpy().flatten())

# save feature as a csv file, per line, with comma
np.savetxt("jtes_f01_ang.csv", feat, delimiter=",")

  


If you face problems during following this article, let me see in comments below.

Reference:
[1] https://docs.microsoft.com/en-us/windows/wsl/install-win10
[2] https://audeering.github.io/opensmile-python/usage.html

Monday, August 02, 2021

Python: memanggil nama variabel secara dinamis dalam loop for

Misalkan kita punya data seperti ini:
a_1 = 1
a_2 = 2
a_3 = 3
Kemudian kita ingin memanggi variabel tersebut secara berurutan dalam loop for. Karena nama-nama variabel tersebut mirip dan hanya berbeda karakter terakhir saj, maka pemanggilan variabel tersebut bisa kita permudah, misalnya dengan cara "a_[i}", dimana "i" adalah indeks mulai dari i. Saya menggunakan kurung kurawal karena implementasi pada teknik yang dipakai juga seperti itu. Pemanggilan nama variabel secara dinamis seperti ini dalam Python bisa menggunakan fungsi "globals()" seperti berikut.
for i in range(1,4):
    print(globals()[f"a_{i}"])
Outputnya adalah nilai a_1, a_2, dan a_3 secara berurutan.
1
2
3

Perbedaan dengan list biasa 

Untuk menampilkan output di atas bisa saja dengan teknik berikut.
for i in [a_1, a_2, a_3]:
    print(i)
Namun tujuan saya bukan output, tapi proses pemanggilannya. Dalam banyak hal, kita butuh memanggil nama variabelnya saja dan mengakses anggota kelasnya. Misal jika variabel "a_" memiliki child (anak) .panjang, .lebar, .tinggi, maka metode tsb (methods dalam pengertian pemrograman) bisa dipanggil dengan teknik nama variabel dinamis di atas. Akan sulit jika memakai list biasa.