EECS E6870: Speech Recognition
January 20, 2016
We will be using Linux workstations in one of the labs
in the EE department (1214/1218 Mudd). The room has badge access and we
don't have permission to enter the lab, so you will need to log in remotely.
To do this, use the program
ssh. For basic information, see
Computing Lab Remote Access. If you want to do graphical stuff
like Matlab plots, you will also need to install X Windows. However,
the labs don't require any graphics, so
installing X Windows is entirely optional.
ssh and X on Windows
The EE department recommends using
To install, click on the preceding link, select
edition, and run the installer.
After running, click on
Start local terminal to start a shell and
then you can follow the directions in Section 2. You can
also click on the
+ to open a new tab/shell.
If you want to have access to the full suite of Linux commands on your local computer, another way to go is to install Cygwin, which provides a Linux-like environment on top of Windows. See Cygwin/X User's Guide for information on how to install X Windows on Cygwin. Installing Cygwin is complex, so we don't recommend this.
ssh and X on OS X
ssh should be preinstalled. If you want X Windows,
you can get this at XQuartz.
ssh and X on Linux
This stuff should be preinstalled.
Getting an account After the first class, we will submit a request to create accounts for all students who are currently registered for the class according to Courseworks. If you are not registered but are planning to register, E-mail Stan to get the process started (include your UNI and E-mail address). When an account has been created, a username and password will be E-mailed to you.
Lab Policy Note that you will be expected to follow EE Computer Lab Policy. Since we do not have physical access to the lab, many of the rules do not apply. Still, there will be students sitting in front of the machines that we will be logging into, so please be considerate. If you do not follow lab policy, your account may be revoked.
Once you have a username and password, you can try logging onto a
machine in the cluster.
The machines are named
To be able to use graphical programs like Matlab when using X Windows, you
need to use the
Do not be alarmed if you see the following error message:
ssh -X <username>@cadpc08.ee.columbia.edu
Not all of the machines may be up at a given time, so if you are having trouble with one machine, try another. To log out, type
Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding.
To change your password On any machine, type the command
and follow the directions.
If your machine seems slow
If many people are using the same machine,
the machine may get slow and you may want to consider switching to
a different machine. To see how busy a machine is, you
can use the command
w. This will list all the users
on the machine, and the numbers after
are the average number of programs currently running (averaged
over the past 1, 5, and 15 minutes).
For those of you who are not familiar with Linux or other variants of UNIX, you need to learn how to use UNIX for basic tasks such as making directories, moving/copying files, redirection, etc., and for editing text files. You're basically on your own for this, but we did some quick Google searches and here are some pointers.
Here is one Unix tutorial and
UNIX tutorial or some other relevant string into Google
for pointers to more material.
To edit text files, if you do not already know a UNIX text editor,
one option is to use X Windows as described in Section 1
emacs. In this scenario,
emacs acts pretty much like a generic text editor.
Otherwise, the two most popular editing tools for UNIX
vi. The editor
weird key mappings, but is simple and compact. The
emacs is extremely powerful and also has
some weird key mappings. Here is an
emacs tutorial and
here is a
If you are not running X Windows;
don't already know
vi; and are too lazy to read
a real tutorial, here is a 1-minute tutorial for
edit the file
You can edit in an intuitive fashion; the arrow keys and page up/down keys work as expected. To do stuff like save, exit, etc., you can use the menu bar at the top. Press the
key to get to the menu bar. When you do this, a window opens at the bottom of the screen with a list of options. Press the letter corresponding to the option you want. Menus can be deep, so you may need to do this several times. (Press
three times to abort.) For example, saving is
and exiting is
F10 f s
. When editing files that end in a C or C++ extension (e.g.,
F10 f e
emacswill enter a special mode that does automatic indenting and highlighting.
In this section, we discuss the things you need to do to set up
your account for this course. By default, you will be assigned
bash. If you don't know what I'm talking about,
you are probably using
bash. If you are using a different
shell, then you will have to adjust the commands in this section
appropriately, but if you are using a different shell, you should
If your account was newly created, first backup the
.bashrc files in
your home directory:
cp ~/.bash_profile ~/.bash_profile.bak cp ~/.bashrc ~/.bashrc.bak
character is an abbreviation for your home directory.) Then, copy in versions of these files from
These files set environment variables as needed for the labs. If your account was not newly created and you have modified these files, then manually merge the contents of the version we supply with your existing version.
cp /user1/faculty/stanchen/e6870/.bash_profile ~ cp /user1/faculty/stanchen/e6870/.bashrc ~
You can type
(or logout and login again)
to have these changes take effect.
Problems with the backspace key
If when you press the backspace key you see a
printed instead (e.g.,
vi on a Mac), then try adding the following line at the end
.bashrc file (and logout and login again):
stty erase '^?'
We will be supporting only C++ for the labs. This is the language the majority of speech recognition software is written in. We'll also mention a little about Matlab and Python, in case you want to play around in these languages by yourself.
We will be providing a small C++ library supplying basic input/output routines and some key data structures. To provide access to this library in Python, we are using SWIG to generate the wrapping code necessary for making this happen. (The library isn't accessible from Matlab.) Documentation for this library will be given in the labs.
We'll be using the GNU C++ compiler,
To compile a program, one can use an incantation like
g++ -g -Wall <source-files> -o <output-file> -lm
signals that debugging information should be included in the executable (see Section 6); the flag
signals to print lots of warnings about questionable programming constructs; and the flag
signals that the math library should be linked in, which you'll probably need for all of the labs. We'll be using version 4.9.3 of
g++, a recent version that includes support for many modern features of C++. To turn on support for C++14, use the flag
To automate the compilation process, one can use
make; here's a
Here's a sample
Note that the indentation in the last line must be the tab character, not spaces. If placed in the current directory in the file
CXX = g++ CXXFLAGS = -g -Wall LDLIBS = -lm hello : hello.C $(CXX) $(CXXFLAGS) hello.C -o hello $(LDLIBS)
Makefile, one can recompile by typing the command
matlab should start up Matlab. If you are
running X Windows (and used the
you should see the graphical interface; otherwise, the command-line
interface will start up (see Section 1). If you can't
find Matlab, the full path is
If for some reason you are having trouble with the Matlab license server, another option is to use
octave, which is open-source software mimicking Matlab. This uses the same syntax for most things, though its function library is not as extensive.
If you completed Section 4 correctly, your
PYTHONPATH environment variables should be set up correctly
to use the desired version of Python and the course Python libraries.
(Don't forget to logout and login again after updating your
In particular, you should be using the Python from
type pythonto check) and
PYTHONPATHshould include the directory
To print the value of
The course Python module is named
asr_lib. To test things
are working, you can try:
python from asr_lib import * print g_zeroLogProb
For those of you who are not robots or cyborgs, you will undoubtedly
introduce bugs into your source code at some time or another. One
simple way to debug stuff is to place
For C++, the GNU
gdb debugger is available. Here is
gdb tutorial and here is
you can also get some documentation within
gdb by typing
help. To start
gdb <program>. Within
run <arguments> to start the program. Commands
that you should know about include
Don't forget to compile your program with the
(see Section 5.1).
Tip: in the provided C++ library, errors are reported either as
assert() failures or as exceptions. It's useful to be
able to set breakpoints on these events when debugging.
To set a breakpoint on an
assert() failure, you can do
If you're asked
Make breakpoint pending ... library load?, say yes. To set a breakpoint on the throwing of any exception, you can do
For future reference, in the interest of preempting debugging questions, here are three procedures you should perform before asking for help in finding a bug:
Code review — Carefully read each line of code to make sure it says what you intended it to say. People make a surprising number of essentially typographical mistakes.
Data review — For each variable with a nontrivial lifetime, read the code and make sure the variable is constructed, initialized, updated, and destructed correctly.
Step through the code — Step through each line of code in a debugger, examining variables to make sure they have the values you think they should have. You may need to step through the same code multiple times, to test different situations that may arise.