Sunday 17 July 2022

Love & Love Only

I love you as my own body
I thank God for bringing you into my life

I fall at your feet
I hear your voice
I hold your hands
I caress you gently
I adore your dimple
I massage your legs
I wrap you in my arms
I listen to your heart beat
I kiss you all over the face
I rest my face on your body
I feel comfort in your embrace
I admire the colour of your eyes
I run my hands through your hair

I share my life with you
I partake in your happiness
I join you in your struggles
I aspire to be more than a friend to you

I apologize for hurting you
I hope to improve myself
I try to tame my tongue
I am willing to change

I miss you, milady
I seek you, sweetheart
I bide my time, beloved
I dwell in my thoughts about you, dear
I wait to meet you soon, wife of my youth
I love you, LOVE

Thursday 14 July 2022

Logicomix

This article is a summary of the book Logicomix: An Epic Search for Truth, written by Apostolos Doxiadis and Christos Papadimitriou.

1. Pembroke Lodge: Russel's struggle in comprehending the illogical world (forbidden fruit of knowledge, religious studies, stern grandmother, faith) and finding solace in the logical mathematics (axioms, proofs, theorems, ...)

2. The Sorcerer's Apprentice: Russel breaks loose from the shackles of his strict religious upbringing and becomes an atheist. Russel embarks on a quest for rationality, reasoning, truth and knowledge about the world. However, Russel finds himself in turmoil over the state of mathematics (unproved axioms, circular definitions) and philosophy (disagreement among philosophers). Russel is introduced to logic and works of Boole (Boolean laws). Russel's mission is now to put the house of Mathematics "Queen of the Sciences" in order.

3. Wanderjahr:  Russel goes to the Continent and meets with Gottlob Frege who dreamed of a new logical language to serve as the foundation of mathematics, and (the insane) George Cantor who developed set theory. Russel attends the 1900 ICM Paris in which there are two schools of thought led by Henri Poincaré (proponent of human intuition) and David Hilbert (proponent of mathematical proofs, reasoning and logic).

4. Paradox: Russel discovers the paradox related to definition of sets (the supposed foundation of logic and mathematics), and publishes it in the `Principles of Mathematics.' Russel and Whitehead collaborate on Principia Mathematica, a planned set of three books to create a new foundation of mathematics. The authors struggled a lot while working on the manuscript, and ultimately self-publish the first volume.

5. Entr'acte: Logicians tend to confuse the abstract (Map) with the concrete (Reality).

6. Logico-Philosophical Wars: Wittgenstein begins to study under Russel. At the same time, Europe is reeling under the tension caused by the Great War. Reality confronts Russel. Wittgenstein, due to his trust in natural language, formulates the `Picture Theory,' according to which statements are meaningful only if they can be pictured in the real world. Thus, the statement "There are at least three things in the universe" is meaningless because we can't picture the universe.

7. Incompleteness: Gödel formulates his incompleteness theorem according to which some questions are unanswerable. Russel and Wittgenstein experiment with reforms in the field of education (authoritarian and anti-authoritarian respectively), but ended up as failures in practice. Russel's life (Nazism, Frege's logically-sound anti-semitic rant, WWII) teaches him that there is no royal path to truth. Instead of renouncing the old Trinity composed of Intuition, Emotion and Habit, Russel proposes the new Trinity composed of Responsibility, Justice and knowledge of Good and Evil.  

8. Finale: John von Neumann and later Alan Turing build upon the hitherto works to come up with the Turing machine and the stored-program architecture, and together they pioneer the field of computer science.

"The meaning of the world does not reside in the world." - Wittgenstein thinks to himself.

"All the facts of science aren't enough to understand the world's meaning. For this, you must step outside the world." - says Wittgenstein to Russel.

"Applying formulas is not good enough when you are faced with really hard problems." - Bertrand Russel.

Tuesday 5 April 2022

Automatic Speech Recognition (Part I)

Conversational AI: Automatic Speech Recognition) --> Natural Language Understanding --> Information Retrieval --> Natural Language Generation --> Text-to-Speech

P(W|O)  = argmax_W P(O|W).P(W)
The acoustic model estimates the observation likelihood P(O|W).
The language model estimates the prior probability P(W).

Applications: YouTube closed captioning; Cortana/Siri/Alexa front end; dictation systems

Resources: phonemes, pronunciation dictionary, speech data (labelled for phonemes and words), word vocabulary
https://openslr.org/index.html

Challenges:

  • speech recording: quality and acoustic range of the mic; 
  • background noise;
  • speaker: speed, age and accent of pronunciation; volume of speech (distance between speaker and mic)
  • language-specific constraints: inflections, no writing system;
  • code mixing; multilingual setting; 
  • speed of ASR (esp. in time-critical applications); 
  • task complexity: identify speaker; account for speech-noise; listen continuously or push-to-talk;
  • train ASR for new languages: create resources such as pronouncing dictionary, learn HMM and n-gram probabilities

Components: Acoustic Model (sampling, Fourier transform from time-domain to frequency-domain, pronunciation dictionary, HMM to map phonemes to word), Language Model (n-gram probabilities, smoothing, back-off, linear interpolation)

time-domain: time vs. frequency (pitch) plot
frequency-domain: extract component frequencies with the corresponding amplitudes

Evaluation: Word Error Rate (WER) is a measure of the word-level edit distance in terms of insertions, deletions and substitutions between the reference and the model output.

Vocabulary: humans learn ~30K words by middle age; in case of an open-vocabulary setting, consider all unknown words as the special token <UNK>

HMM: observations (phonemes), states (words), decode the HMM (estimate the best state sequence), train the HMM, evaluate the HMM (estimate the best observation sequence)

International Phonetic Alphabet: list of phones; English has 26 letters to convey the 44 syllable sounds;

CMU Pronunciation Dictionary (CMUdict): mapping between words and phones for North American English; 134000 entries; challenges (names, inflections, numbers)

ASR: CMU Sphinx (2015), Espresso (2019), NeMo, Whisper
TTS: WaveNet (2016), Tacotron (2017)

frequency (pitch)
amplitude (loudness)
waveform;
digitization (sampling, quantization); spectrum computed using Fourier transform; spectrogram; spectral features as vectors (LPC, PLP); phone likelihood estimation (using neural networks);

How to train an HMM?
How to remove background noise?
How to build ASR for different dialects of English?
Do we need a resource that is labelled for phonemes?
How to map speech to phonemes?
Why not build end-to-end ASR systems?

On Construction of the ASR-oriented Indian English Pronunciation Dictionary

https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/asr/asr_language_modeling.html

Monday 7 March 2022

Principles of Computing

 

Theorems or Adages

  • No Free Lunch theorem - there is always a trade-off; originally proposed in the context of search and optimization
  • Black swan theory - theory on seemingly unexpected grand events
  • Hofstadter’s law - "It always takes longer than expected, even if you take into consideration the Hofstadter’s law."
  • Murphy’s law - "Anything that can go wrong will go wrong."
  • Infinite monkey theorem
  • The Chinese Room Argument - [discussed under Linguistics]
  • Pigeonhole principle
  • Moravec’s paradox - While hard tasks such as playing Go, logical reasoning, algebra are easy for AI systems, easy tasks such as moving an object, using common-sense are hard for AI systems.
  • AI effect refers to the tendency for onlookers to dismiss (artificial) intelligence for sheer brute force, number crunching or plain computation. This effect is also observable in magic when the trick gets revealed to the audience.
  • Church-Turing Thesis - Can a Turing machine compute everything that is computable? What is an algorithm? The Church-Turing thesis states that the Turing Machine model is at least as powerful as any computer that can be built in practice. The Church-Turing thesis states that known programming languages are capable of describing everything that could be described as an algorithm. In other words, it says the conventional definition of "algorithm" as that which can be done by executing programs-as-we-know-them is the right definition.
  • Turing-completeness - In computability theory, a system of data-manipulation rules (such as a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing-complete or computationally universal if it can be used to simulate any single-tape Turing machine. So, if somebody says "my new thing is Turing-complete" that means in principle (although often not in practice) it could be used to solve any computation problem. A basic calculator or a scientific calculator is not Turing-complete. Programming languages are similar to those machines (although virtual). They take programs and run them. Most programming languages, conventional and unconventional, such as C, Java, Lisp, Haskell and Prolog, are Turing-complete. The typesetting language LaTeX is also Turing-complete. However, markup languages such as XML and HTML are non-Turing-complete languages. Formal languages such as regular languages and context-free languages are Turing complete. On the other hand, logics such as propositional logic and predicate logic are not Turing complete.
  • AI-complete - The hardest problems in AI (such as vision, natural language understanding, and planning) are AI-complete. In other words, solving an AI-complete problem is equivalent to making computers as intelligent as people.
  • Strong AI vs. Weak AI - Strong AI is general AI (a.k.a. AGI) that can perform any intellectual task that a human being can. Weak AI (a.k.a. narrow AI) is AI that can perform specific intellectual tasks (e.g. IBM Watson).
  • Friendly AI - FAI is general AI that would have a positive impact, rather than a negative effect, on humanity. The closely-related areas are machine ethics and AI takeover.
  • Colossal Disaster - IBM Watson is merely a massive engineering (and marketing) effort comprised of heavy parallelism, huge knowledge base and clusters. The technologies that power Watson include (1) information retrieval and information extraction, (2) computational linguistics (statistical paraphrasing, semantic role labelling), (3) machine learning and (4) knowledge representation and reasoning (temporal reasoning, geospatial reasoning). Watson is expert at playing Jeopardy!. So maybe it is an expert system. But is it an AI system? Roger Schank doesn’t think so because it is yet to display intelligence. If it were an AI system then it should be able to answer the following kinds of questions: (1) between Jim and Betty, who is the better person to lead our new social initiative while creating a more transparent culture, (2) can you create an operational strategy to achieve these revenue objectives, (3) how would you rate the CEO’s speech on employee morale?, (4) how do you think this marketing campaign will impact our customers and prospective customers, or (6) was Jim’s joke funny? These questions pertain to request for opinion, strategy and complex phenomena such as morale, jokes, feeling and emotions.
  • Recommender systems - The technosphere is filled with recommender systems such as Google search, Facebook feed, Twitter feed, YouTube video recommendation and Amazon product recommendation.
Computer Languages
  • General Purpose Programming Language: C (procedural programming, ancient); Java (no pointers, garbage collector, enterprise language, statically typed, Hibernate database application framework, Struts and Spring web application frameworks); Scala (object-oriented + functional programming, statically typed); C++ (object-oriented programming)
  • Scripting Language: Python (dynamically typed, Django web application framework); awk (structured text search and replace)
  • Functional Language: Haskell (functional programming, statically typed)
  • Logical Language: Prolog (logic programming)
  • Query Language: SQL (query rdbms database); XPath (query xml database)
  • Shell Programming Language: bash (run commands from script)
  • Data Language: HTML (exchange data, common in www); XML (exchange data)
  • Modelling Language: RDFS (less expressive modelling); OWL (more expressive modelling)

Saturday 5 February 2022

Deutschlernen Tracker

Dictionary

Grammar

  • YourDailyGerman
  • Accusative prepositions:  für, ohne, durch, um, gegen
  • Dative prepositions: aus, nach, von, bei, zu, mit, ab, seit, außer
  • Two-way prepositions: use the accusative case when there is a position change from point A to point B; use the dative the rest of the time.
    • Ich bin im Kino.
    • Ich gehe ins Kino.
  • The adverb always comes after the verb.
  • Prepositions with Locations: in (inside, as in classroom), an (near, as in beach), auf (on a surface or at a public building such as bank), bei (specific places, as in Zentralmensa) 
    • an der Universität
  • Adjective endings, http://www.nthuleen.com/teach/grammar/adjektivendungenexpl.html
  • Articles
  • Conjunctions
    • Wenn das Wetter gut ist, dann wandern viele Leute nach Heiligenberg. 
    • Weil das Wetter gut ist, wandern viele Leute nach Heiligenberg. 
    • Viele Leute wandern nach Heiligenberg, obwohl das Wetter schlecht ist.

Vocabulary

  • Ankidroid
  • Clozemaster app

Listening 

  • nachrichtenleicht.de
  • SlowGerman (Annik Rubens Podcast)
    • Was wären wir ohne Internet? SG #238
    • Das Schloss Neuschwanstein – SG #237
    • Arm und reich in Deutschland – SG #223
    • Die Hobbys der Deutschen – SG #218
    • Die Uhrzeit – SG #210
    • SG #192: Online-Shopping
    • SG #147: Die Bahn in Deutschland
    • SG #011: Denglisch
    • SG #009: Bus und Bahn 
    • SG #160: Die Volkshochschule

Writing

Reading

Video Series
  • Nicos Weg 
    • Nicos Weg A1
    • Nicos Weg A2
  • Extr@ (German)
    • EXTRA auf Deutsch - Folge 01 | Sams Ankunft
    • EXTRA auf Deutsch - Folge 02 |
    • EXTRA auf Deutsch - Folge 03 | Sam hat ein Date
    • EXTRA auf Deutsch - Folge 04 | Sam sucht einen Job
    • EXTRA auf Deutsch - Folge 05 | Ein Star ist geboren
    • EXTRA auf Deutsch - Folge 06 |
    • EXTRA auf Deutsch - Folge 07 | Der Zwilling
    • EXTRA auf Deutsch - Folge 08 | Die Kusine der Vermieterin
  • Pluspunkt
  • Kendra's Language School

Friday 4 February 2022

Modern DS Software Development

Team Structure

  • Developers
    • Planning: Agile (SCRUM, Kanban)
    • Coding: version control system (svn, git), integrated development environments (Eclipse, PyCharm)
    • Building: makefile, Maven (pom.xml)
    • Testing: Selenium, HP QTP
  • DevOps: Jenkins
  • Operations
    • Deploy: Docker
    • Operate
    • Monitor: Nagios

Web Development

  • browser: Firefox, Chrome, Safari
  • PL: what to do (Java, JavaScript, Python, Ruby, PHP)
  • HTML: what to show
  • CSS: how to show
  • database: how data is stored (MySQL, Oracle, MongoDB)
  • data format: how data is exchanged (JSON, XML)
  • framework: platform or content-management system (Struts/Java, Meteor/JavaScript, Django/Python, Rails/Ruby, WordPress/PHP, Drupal/PHP)
  • front-end: browser, HTML, CSS, PL
  • back-end: server, database
  • client: user of a web application
  • server: where application is stored
  • protocol: how machines communicate (HTTP)
  • cloud computing services
    • compute power, database storage, DBMS, AI services;
    • SaaS (Google Apps); PaaS (Amazon retail, Flipkart retail); IaaS (Google Drive, Amazon Web Services, Microsoft Azure);Network-as-a-Service or NaaS (Asianet ISP); Data-as-a-Service or DaaS

ELK Stack: ElasticSearch (full-text search engine, run ML); Logstash; Kibana (data analysis and visualization)

Databases

  • Relational (SQL) databases
    • have to have a schema
    • poor horizontal scaling (possibly due to tight coupling between tables)
    • e.g. SQL Server, MySQL
  • NoSQL
    • enables better horizontal scaling (adding new servers, partitions)
    • no need to have a schema (good for constantly evolving data)
    • flexible
    • key-value storage (JSON)
    • e.g. MongoDB, Cassandra
Docker
  • facilitate faster application delivery and deployment; ensure portability by separating application from infrastructure; enables a microservice-based architecture
  • wrap OS, dependencies, configuration, directories and files (and not data) into a single lightweight application
  • follows a client-server architecture; relies on Linux virtualization, cgroups, namespaces
  • use Dockerfile to build a Docker image
    • FROM (choose base image), MAINTAINER (for documentation purpose), RUN (execute commands during image building), CMD (execute commands by the running image), ADD (files to image), ENV (define environment variables), VOLUME, WORKDIR (change working directory), USER
  • save images on (public/private) registry, e.g. Docker Hub
  • run images as a Docker container
  • use volumes for persistent data
  • Docker commands
    > docker pull, push
    > docker create, run, start, kill, rm, stop, commit
    > docker images, rmi, ps, logs

Kubernetes

  • container orchestration platform
  • automatically deploy, manage and scale containerized applications
  • k8s cluster services
  • application configuration (app1.yaml file)

Principles of Rhetorics

Gricean Maxims

The Gricean maxims is a set of four principles for effective communication. When the maxims are followed correctly, the speaker is able to communicate effectively to the listener.

  • According to the Maxim of Quantity, share only the right amount of information that is suitable for the conversation.
  • According to the Maxim of Quality, share only information that is true and supported by sufficient evidence.
  • According to the Maxim of Relevance, share only information that is relevant to the conversation; that is, do not divert from the topic.
  • According to the Maxim of Manner, be clear, unambiguous and orderly while engaging in a conversation.
Bias
  • Algorithmic bias -
  • Inductive bias (or learning bias) - assumptions used by a learning algorithm to make prediction on unseen data e.g. maximum margin in SVMs, test of generalization power using test data, Occam’s razor
  • Cognitive bias
    • Confirmation bias - the tendency to favour information that agrees with previously held beliefs
    • Gender bias, racial bias - the tendency to believe that a certain gender (typically women) and certain races (typically black) are intellectually and physically weak
    • Systemic bias - discrimination inherent in the system e.g. Apartheid
    • Selection bias - the bias introduced by the selection of individuals; bias introduced due to incomplete data e.g. in surveys
    • Stereotyping - the tendency to attribute a certain characteristic to an entire group based on lack of evidence e.g. All Muslims are terrorists. All white people are racists.
    • Survivorship bias - tendency to focus on individuals that survived and overlooking the ones that failed to make it due to their lack of visibility; e.g. WW2 bombers (the others that were shot down), All IITians bag 1Cr packages (the others don’t even make the headlines).
    • Information bias - the tendency to seek information when it does not affect action

Fallacies

These tactics are commonly employed in debates and political speeches to distract the masses or to avoid discussing the topic at hand.

  • Red herring - tool for distraction
    • Straw (weak) man - argument based on a weaker or misrepresented version of the opponent’s position
    • Ad hominem - attack the arguer (1) appeal to motive, (2) appeal to authority, (3) appeal to hypocrisy (whataboutism)
  • cum hoc ergo propter hoc - correlation does not imply causation
  • No true Scotsman - change the generalization by excluding the counterexample
  • Cherry-picking - pointing at individual cases from a population to support one’s argument while ignoring evidence from the population to the contrary
  • Appeal to consequences - argument primarily based on consequences of the argument e.g. caste-based politics (Hindu khatre mein hain!)
  • Appeal to tradition - argument primarily based on premises that are long held to be true e.g. conservatives
  • Appeal to emotion - argument primarily based on manipulation of emotions rather than using valid, logical reasoning e.g. speech by politicians

Ethics and Philosophy

  • Trolley problem: who should I save; how to make this decision; e.g. autonomous driving
  • Tragedy of the Commons: individual goals vs. collective goal; e.g. female infanticide;
  • Prisoner's dilemma: cooperation vs. competition; trust issues;
  • Volunteer's dilemma: should I sacrifice a little to benefit others; e.g. പൂച്ചക്കാര് മണികെട്ടും; 
  • Bystander effect: someone else will do it; e.g. mass emails vs. personal emails; sense of responsibility is tied to presence of bystanders; 
  • Allegory of the cave
  • Principle of double effect: e.g. Is it lawful to kill a person in self-defense?, ധർമ്മസങ്കടം

Tuesday 25 January 2022

Western Music Piano

Notation: C Major refers to the key and Cmaj refers to the triad.

Practise scales and chords with both hands.
Practise time using metronome.
Learn all scales (major, natural minor and harmonic minor)
Learn all diatonic chords in a scale (major, minor, augmented, diminished, suspended)
Practice chord inversion

Learn chords progression
Memorize time intervals

Learn Sight Reading
Learn Sight Singing

Rhythm

http://musictheorysite.com
http://www.pianolessons.com/
http://pianomeditation.com/

Staff
Stave lines represent the lines with the notes, clefs, key signatures, and time signatures of a song. The various types are Single Staff, Double Staves.

Clef
Clefs move the stave lines up or down the pitch ladder. The various types are Treble Clef (G Clef), Bass Clef (F Clef), C Clef (Alto Clef, Tenor Clef). The middle C is exactly between the Bass clef and the Treble clef.

Pro Tip:

Treble lines: Every Good Boy Deserves Fudge.
Bass lines: Green Birds Don’t Fly Away

Treble spaces: FACE,
Bass spaces: All Cows Eat Grass

Note that the Treble clef is called G clef because the clef sign wraps around the G line. Similarly, the Bass clef is called F clef because the dot are on either side of the F line.

Note
A pitch is a frequency of sound. A note is a named pitch. The pitch of piano key C4 is different from that of key C5. There are 12 notes in Western music. After twelve, the notes repeat in the next higher register or octave. The notes are C, C#(Db), D, D#(Eb), E, F, F#(Gb), G, F#(Ab), A, A#(Bb) and B.

Scale (Key)
Key signature denotes how many sharp and flat notes appear in a song. The sharp and flat notes raise a note by a half, or even a full, step. Not all notes in a scale are used in a song. Many songs work with just 7 notes creating a harmony. In every key, notes in same position work in the same way.

We play a scale. We cannot play a key. A song is in some scale or key.

A scale is a group of notes played in succession. Chords are built from scales.The various types of scales are major, minor(natural, harmonic, melodic), blues, jazz, pentatonic and so on. Pentatonic scales are based on major or minor scales. The various examples are C Major, C natural minor, C harmonic minor, C melodic minor, C major pentatonic, C minor pentatonic...

Every scale has a formula.

  • The Major scale formula is W - W - H - W - W - W - H. It is a cool major scale.
  • The Natural minor scale formula is W - H - W - W - H - W - W. It is a cool minor scale.
  • The Harmonic minor scale formula is W - H - W - W - H - WH- H. The problem with natural minor is that the leading tone is absent.
  • The Meladonic minor scale formula is W - H - W - W - W - W - W. The problem with harmonic minor is the large gap between 6th and 7th notes.

Relative scales share key. A relative minor scale is built from the sixth degree of the major scale. The relative scale of C major is A minor. In C major, the root note C is special. In A minor, the root note A is special. The same note plays a different role in each relative scale.

Time
Time signature denotes the number of notes in a measure and the note values that gets the beat. The various types are 4/4, 3/4, 5/4, 6/8, 3/8 and 2/2. In the 4/4 time, there are four beats in a measure and one quarter note gets the beat.

Interval
The smallest interval in Western music is a half step or semi tone. A major second will have the same feeling in any scale.

Perfect First (Unison): 00 half step
Minor Second: 01 half step (JAWS soundtrack)
Major Second: 02 half steps (Happy Birthday)
Minor Third: 03 half steps
Major Third: 04 half steps (Kumbaya my LORD)
Perfect Fourth: 05 half steps (Here comes the bride)
Tritone: 06 half steps
Perfect Fifth: 07 half steps (Mary had a little lamb)
Minor Sixth: 08 half steps
Major Sixth: 09 half steps (My Bonnie lies over the)
Minor Seventh: 10 half steps
Major Seventh: 11 half steps (Take on me)
Perfect Eighth (Octave): 12 half steps

In short, there are eight types of intervals classified into two:

  1. Perfect: first, fourth, fifth, eighth
  2. Major: second, third, sixth, seventh

Tritone is a dissonant interval.

In addition, an augmented interval is a half-step larger than a perfect or a major interval, and a diminished interval is a half-step smaller than a perfect or a minor interval.

There are multiple ways to call the same interval:

tritone = augmented perfect fourth = diminished perfect fifth
Major sixth = augmented minor sixth =diminished octave
Minor third = augmented major second = diminished major third

Intervals can also be inverted. Perfect intervals remain perfect upon inversion. Major intervals become minor (and vice-versa). Augmented intervals become diminished (and vice-versa).

Chord
A chord is a group of notes. The different types of chords are Cmaj, Cm, Csus, Caug, Cdim, Cmaj7, Cmin7, C7, Csus4, C7sus4, C6, Cmin6, C7-5, C7+5, Cm7-5 and A/C.

A triad is a chord constructed with 3 notes. The various types of triads are major (happy), minor (sad), augmented (mysterious) and diminished (dissonant). Every triad has a formula. A major chord is a chord that has a root, major third, and perfect fifth. A minor chord is a chord that has a root, minor third, and perfect fifth. An augmented triad is a chord, made up of two major thirds (augmented fifth). A diminished triad is a triad consisting of two minor thirds above the root. A suspended chord (or sus chord) is a musical chord in which the (major or minor) third is omitted, replaced usually with either a perfect fourth or a major second although the fourth is far more common.

Extended chords are extension to the triads. Various extended chords are 7 chords, 9 chords, 13 chords and so on. Types of 7 chords are Major 7 (maj7), Minor 7 (m7) and Dominant 7 (7).

Slash chords are another type of chords. An example is A/C.

Diatonic chords are chords that naturally belong to a key. The pattern of diatonic chords for a Major key follow a formula: 1(Major) - 2(Minor) - 3(Minor) - 4(Major) - 5(Major) - 6(Minor) - 7(Diminished). The pattern of diatonic chords for a Minor key follow a formula: 1(Minor) - 2(Diminished) - 3(Major) - 4(Minor) - 5(Minor) - 6(Major) - 7(Major). Each diatonic chord has a function - tonic, subdominant, dominant. For example, in the major scale, the function is shown in brackets: I(t) - ii(s) - iii(t) - IV(s) - V(d) - vi(t) - vii(d)

Chord inversion gives a nice flavor to the original chord. They are useful for making progressions on piano easier to play and smoother sounding. A triad has a root inversion (root is at the root position), a first inversion (root note is at the top position) and a second inversion (root note is at the middle position). A 7 chord has a root inversion, first inversion, second inversion and third inversion.

Chord Progression

A chord progression is a series of chords played in a pattern.
e.g. I-IV-V-I
e.g. I-VI-II-V-I

1 - any
2 - 5
3 - 6
4 - 1 or 5
5 - 1
6 - 2

Counting Notes
Everything written below is w.r.t. the common time.
A whole note spans the whole of a measure.
A half note spans a half of a measure.
A quarter note spans a quarter of a measure. There are one quarter note in each beat and four quarter notes in a measure. (One Two Three...)
An 8th note spans 1/8th of a measure. There are two 8th notes in each beat and eight 8th notes in a measure. (One and Two and Three and...)
A 16th note spans 1/16th of a measure. There are four 16th notes in each beat and sixteen 16th notes in a measure. (One ee and a Two ee and a Three ee and a...)
An 8th note triplet is three 8th notes in each beat. There are four triplets in a measure. (One and a Two and a Three and a...)
A 16th note triplet is six 16th notes in each beat. There are four triplets in a measure.

Friday 31 December 2021

Review: OOP Concepts

OOP Concepts: Encapsulation, Inheritance (reuse properties and behaviours), Polymorphism (method overloading and method overriding), Abstraction (abstract classes and interfaces)

 - parameter (function declaration) vs. argument (function call)
 - method vs. function

 - access specifier: private (only within class), default (within the package), protected (within same package and for subclasses), public
 - abstract (just idea; define in subclass) vs. interface (all methods are abstract)
 - extends (wrt class) vs. implements (wrt interface)
 - final (cannot override)
 - static
 - super vs. this
 - static binding (method overloading) vs. dynamic binding (method overriding)

 - single-level inheritance vs. multi-level inheritance
 - multiple inheritance vs. hierarchical inheritance
 - hybrid inheritance

 - getter vs. setter
 - high cohesion vs. loose coupling

Monday 8 November 2021

Every Good Endeavour - Tim Keller, Katherine Leary Alsdorf

Introduction

obstacles - expressive individualism; job vs. vocation; work to live vs. live to work

hope - Leaf by Niggle by J.R.R. Tolkien (the author of The Lord of the Rings, writer's block, question his vision to produce a fantasy, in the league of The Iliad, The Mahabharata); our work will bear fruit in heaven; Is this idea backed by the scripture?

how to make the right choice - ability (Can you do it?), affinity (Do you like it?), opportunity (Is there any open position?);

Part One: God's Plan for Work

1. The Design of Work - God-ordained; God did work and God saw that the creation was good; God took rest; Jesus was a carpenter (The Chosen); Paul was a tent-maker;
2. The Dignity of Work - basic human need; The Remains of the Day by Kazuo Ishiguro (depicts the dignity of labour, the protagonist is a butler); Mike, the doorman;
3. Work as Cultivation - culture mandate (culture building); job description (Genesis 1)
4. Work as Service - the Divine providence; spiritual work vs. secular work (Martin Luther, we have many needs including food, clothing, shelter, WiFi);

Part Two: Our Problems with Work

1. Work becomes fruitless - sin (paradise lost, things fall apart); two extremes: idealism (optimistic about good end-result) vs. cynicism (pessimistic about good end-result); choice (post-war years vs. current years, my parents' generation vs. my generation); wrong job probably;

2. Work becomes pointless - Ecclesiastes (meaningless, chasing after the wind;); alienated labour, Karl Marx (unable to see the end-result, agrarian economy vs. industrialized economy vs. service economy);

3. Work becomes selfish - Tower of Babel (establish one's identity, pride in one's own labour, tribalism to ensure security); Esther "in the Palace"; the Ovarian lottery (privilege, grace of God); IIT-JEE top rankers (identity through CS IITB); competitive pride (C.S. Lewis, publish or perish, by hook or by crook);

Idols of `Workship': Idol is something that is prominent, takes away too much of your energy and is considered sacrosanct. (1) traditional: collectivism (racism, religious fundamentalism, casteism, nationalism); (2) modern: individualism, emphasis on science, facts and figures, power of reasoning; and (3) post-modern: rise of cynicism (e.g. Terminator, Jurassic Park), liberalism (e.g. gender fluidity), means-without-an-end. 
Christians ought to discern the idols functioning in their professions and industries. Some examples are shown below:
  • Idols in UESI Ministry: organize camps vs. personal evangelism, share gospel vs. build relationships, study WoG vs. practise WoG;
  • Idols in NLP research: publication quantity vs. value of output; SOTA vs. elegance;

Part Three: The Gospel and Work

a new worldview: three questions (origin, purpose, destiny); the gospel worldview (everything was good, the world is fallen, Jesus as the embodiment of God's grace); think of the gospel as a pair of glasses through which you look at everything else in the world;

impact of gospel view on society: culture of Europe and the West in general; high regard for human rights; development of democracy; civil society (waste management, punctuality, product quality, efficiency at work);

dualism vs. integration at work: wrong notion that Christian work means taking part in overtly Christian activities; the danger of excessively spiritualizing things in life;

the doctrine of common grace (everybody is created in the image of God; Psalm 19); appreciate the work done by non-Christians; the Divine providence; avoid disengagement with popular culture (James Cameron, Hans Zimmer, Blessy, JRR Tolkien, CS Lewis, Vaikom Muhammad Basheer, MN Karassery, Sunil P Ilayidom, Santhosh George Kulangara);

ethics and morality at workplace: personal dishonesty (e.g. exaggerate current salary), corruption (e.g. lobbying), lack of transparency (e.g. complex financial instruments);

How to incorporate faith into work? 

  • in general: respect coworkers and colleagues; exercise wisdom (know God, know oneself, learn from experience, the book of Proverbs, the Holy Spirit); be generous with time and investment; display resilience under distress or failure;
  • gospel worldview and business: serve the common good; profits are not inherently evil;
  • gospel worldview and higher education: improve quality; make it accessible to everyone regardless of background, sex or race; avoid pride (IIT/IITM, Ivy League)

Do the right thing not because of the incentives it brings but because it is the right thing to do.

"Yet when I surveyed all that my hands had done and what I had toiled to achieve,
everything was meaningless, a chasing after the wind;
nothing was gained under the sun." (Ecclesiastes 2: 11)

"I have fought the good fight, I have finished the race, I have kept the faith. Now there is in store for me the crown of righteousness..." (2 Timothy 4: 7, 8a)

vocational discipleship

How can we have any freedom from the temptations of work and still keep our job?

motivation: passion (passion of the Christ), living sacrifice (Romans 12: 1); serve the work;
rest: rest in the finished work of God (Leaf by Nibble);

people matter < institutions matter

References

  1. Book URL
  2. Study guide, Nancy Erisman
  3. Keller/Alsdorf, Redeemer Church
  4. Alsdorf, ToW

 

Tuesday 8 June 2021

The Pursuit of God, A. W. Tozer

https://bible.org/series/pursuit-god

1. Following Hard after God

  • Do you want to pursue God and only God?
  • God has put the desire in us to pursue Him.
  • I, the seeker, is already in God's hands.
  • Seeker sought (Zacchaeus)
  • conscious, personal awareness
  • too much focus on "accepting" Christ (not seen in the Scripture; the Pentecostal faith, baptism, religious externals)
  • religious simplicity (personal experience, read a book, talk a walk in the woods) vs. religious complexity (programs, organizations, movements)
  • pursue only God (instead of God-and)

2. Blessedness of Possessing Nothing

  • What is the first barrier that keeps you away from God?
  • Abraham was rich and owned servants, cattle but possessed nothing
  • "tyranny of things"
  • poor in spirit (soul poverty, beatitude)
  • intangible assets (talents, gifts)

3. Breaking the Veil

  • What is the second barrier that keeps you away from God?
  • Two kinds of prison: remember Brooks in Shawshank Redemption; the physical prison and the mental prison
  • Let go of ego.
  • Self is the veil.
  • Mother Teresa, Father Damien, Nelson Mandela, Mahatma Gandhi

"Self is the opaque veil that hides the face of God from us. It can be removed only in spiritual experience, never by mere instruction. We may as well try to instruct leprosy out of our system. There must be a work of God in destruction before we are free. We must invite the cross to do its deadly work within us."

4. Apprehending ("Understanding") God

  • God and the spiritual world are real.
  • It is possible for us to experience God with all the five senses (sight, hear, smell, taste, touch). I believe this nature of God manifests itself in Jesus, the second person in the Trinity.
  • intimate relationship ("bhakti tradition")
  • A Christian's beliefs are practical (healing, miracles of prophets, Jesus).
  • The object of a Christian's faith is unseen reality. Remember Hebrews 11: 1 ("Now faith is being sure of what we hope for and being certain of what we do not see."). It is not mere ideas or abstract, but tangible and concrete.

5. The Universal Presence

  • God is here.

6. The Speaking God

  • God is still speaking.
  • The Word of God -> The Voice of God ("the donkey that talks, the book that speaks")
  • The heavens *declare* the glory of God; the skies *proclaim* the works of His hands.
  • The Word of God is quick and powerful. In the beginning, He spoke to nothing and it became something.
  • The Voice of God is a friendly Voice.
  • Voice vs. Noise
  • The Deaf Maestro

7. The Gaze of the Soul

  • What is faith? Do I have faith?
  • Believing is Seeing (vs. Seeing is Believing).
  • Directing our attention to God is the physical manifestation of our faith.
  • remember The Serpent on the Pole
  • the act of seeing (simple act, can be done anywhere and anytime, no religious paraphernalia)
  • The Twin Sisters (and their Twin Husbands)

"അവങ്കലേക്ക് നോക്കിയവർ പ്രകാശിതരായി, അവരുടെ മുഖം ലജ്ജിച്ചു പോയതുമില്ല." (സങ്കി 34:5)

8. Restoring the Creator-Creature Relationship

  • Be Thou exalted!
  • over my possessions, friendships, comforts, reputation
  • consequences: Eli and two sons, Samson
  • OTOH, God does not mind our weaknesses: fishermen as disciples, Moses
  • The choices that we make reflect our faith (God vs. money, God vs. human love, God vs. personal ambition, God vs. self, God vs. men, ...)
  • Christian life ought to be simplistic, easy yoke, light burden, not complicated

9. Meekness and Rest

  • burden of pride
  • burden of pretence
  • become as little children (no pride or pretence)
  • no pride --> meek --> rest
  • meekness != punching bag; meekness boldness
  • not people-pleaser, but God-pleaser --> rest

"Come to me, all who are weary and heavy-laden, and I will give you rest"

10. The Sacrament of Living

  • sacred (praying, Bible reading, singing hymns, attending church) vs. secular (eating, working, playing) dichotomy
  • in everything, honour, glorify God

Tuesday 1 June 2021

Artificial Intelligence: A Guide for Thinking Humans, Melanie Mitchell

Prologue; Part I:  BACKGROUND

The goal of AI is, supposedly, to solve intelligence and use it to solve everything else.

The main hypothesis behind the creation of AI is that any aspect of learning or intelligence can be simulated by a machine. Brain is composed of cells, neurons, and matter that obey laws of physics.

Two problems associated with the development of AI are: (1) people are rushing blindly and deliriously to create AI without giving a thought on its implications, and (2) the trivialization of humanity (emotions, society, music, art, games, movies, literature).

Technological singularity is the point at which machine intelligence surpasses human intelligence, which leads to an intelligence explosion. This happens because an intelligent being is capable of creating an even more-intelligent being. Ray Kurzweil is a proponent of technological singularity and forecasts that singularity is imminent in a few decades. Ray Kurzweil attributes his prediction to exponential growth, Moore's law, neuroscience, virtual reality. He also predicts that a computer will pass the Turing Test by 2029. The two main arguments of his sceptics are: (1) intelligence does not reside solely in the brain; that all the senses associated with the human body are necessary for intelligence to operate (social intelligence, emotional intelligence), and (2) software has not shown any exponential progress.

PART II: COMPUTER VISION

ImageNet (~WordNet) is a dataset of images built with the help of annotators recruited using Amazon Mechanical Turk. AlexNet solved the task of object identification in ImageNet using convolutional neural-networks (ConvNet) and GPUs.

Some technical challenges to AI are (1) the long tail, (2) easy to fool (adversarial examples), (3) bias, (4) supervised learning is not how humans learn; unsupervised learning is the dark matter of AI, (5) data-hungry systems "big data", need a lot of labelled data, (6) inability to interpret the results "show your work", (7) spurious correlation "clever Hans", (8) rely on human understanding of the task in model design, hyperparameter tuning.

We already use AI systems in our day-to-day lives: recommender systems (Amazon, YouTube), web search engines (Google Search, Microsoft Bing), translators (Google Translate, DeepL), personal digital assistants (Alexa, Cortana, Siri). However there are some issues of dispute and concern. How to enforce ethics in AI? How to regulate development and deployment of AI especially in domains such as mass surveillance, face recognition, and arms race? Do we need to teach morality to machines "moral machines"?

Part III: LEARNING TO PLAY

Reinforcement Learning (RL)

Reinforcement learning is a type of machine learning in which the agent learns by itself through reinforcement (rewards) from the environment. Humans learn to ride the bicycle through a similar process. 

The primary approach in RL is to learn the Q-table through multiple episodes (one episode corresponds to a complete game of Breakthrough) and multiple iterations (one iteration corresponds to a single action such as one move). An evaluation function evaluates the current states and predicts the next move by exploiting and exploring the set of values for each possible action. These value of an action indicates the agent's estimate of the reward at the end of the episode if that action is chosen at a given state.

For domains with simple state description, computing the Q-table is easier.  The objective then is to compute values of each action at every possible state. However for complex domains such as self-driving cars which can have inputs from thousands of sensors, neural networks can be used to process the input and generate the state description. These neural networks can then group similar states together through its state representation.

Game Engines

Traditionally, game engines such as IBM Deep Blue (vs. Garry Kasparov, 1997) relied on game trees and pruning algorithms such as minimax. However generating the game tree in real-time for games such as Go proved to be difficult even with sophisticated computing power.

With the advent of deep learning, it has been shown that it is possible to learn the Q-table through the use of neural networks. These Deep Q-Networks (DQN) employed a technique called temporal difference learning, which is based on the hypothesis that the evaluation function becomes more accurate as the games proceeds. 

DeepMind developed AI game engines that relied on deep Q-learning on Atari games and Go (AlphaGo vs Lee Sedol, 2016) Specifically, AlphaGo employed a combination of techniques: convolutional neural networks, deep Q-learning, Monte Carlo tree search and powerful hardware.

Simulation to Reality

However it is difficult to transfer the knowledge gained by the agent to other domains (due to lack of understanding or capabilities of abstraction or transfer learning) or into the real-world (due to ambiguity, noise, unpredictability). These models are also vulnerable to adversarial examples.

While board games or Atari games are easy to solve by current AI systems, these domains are not so challenging. The simple game of dumb charades will be much more harder because the game requires visual, linguistic and social understanding.

Moreover, though it is claimed that the RL agents are capable of learning by themselves without any specialized domain knowledge, the agent receive some amount of guidance through the choice of model architecture and hyperparameters.

PART IV: NATURAL LANGUAGE PROCESSING (NLP)

AI has been very successful in speech recognition.

The use of language is a major hallmark of human intelligence. Reading and writing are specific to humans. Humans all over the world talk. The main component of the Turing Test is language.

The recent advances in NLP can be attributed to  word embeddings (which are based on distributional semantics), recurrent neural networks and pre-trained language model (GPT-2, BERT).

Machine translation is an active research area. Though machines perform well, the evaluation method (BLUE score) is flawed. They make mistakes. They are vulnerable to adversarial examples or in the presence of noise (e.g. grammatical errors, SMS text). They do not work well on low-resource languages (e.g. Indian languages).

Question answering is another active research area. IBM Watson beat the world champion in the quiz show Jeopardy! Though digital personal assistants such as Siri, Cortana, Alexa perform question-answering, typically they perform mere answer retrieval. 

PART V: MEANING AND UNDERSTANDING 

The primary traits of human intelligence are the following: 

  • intuitive physics (e.g. world is composed of objects, objects have weight), intuitive biology (e.g. that there are animate and inanimate objects), intuitive psychology (social intelligence), 
  • knowledge of abstract and concrete concepts (metaphor), abstraction (ability to generalize between concepts) and analogy making (identify common essence between two concepts), 
  • cause and effect (e.g. if we push an object, the objects moves unless it is heavy or pulled by somebody else), predict possible futures,  simulate counterfactual events (e.g. tsunami in Heidelberg), ability to reason (use knowledge), 
  • self-awareness (consciousness)

Bongard problems are designed to test the abstraction and analogy-making skills of AI. Copycat was an approach that tested these skills in a microworld --- the letter-string domain.

Cyc is an ongoing project to teach machines common-sense.

Humans have the power of metacognition, in addition of cognition. We can think about, and reason on, what we think and what others think.

Q1: How soon are self-driving cars going to a reality? Ans: We're still far, far away from developing fully  autonomous vehicles.

Q2: Will AI replace all jobs? Ans: AI will likely create a new set of jobs. AI will replace low--pay, boring, degrading, dangerous jobs.

Q3: Should we be scared of AI? Ans: Humans need not be scared of super-intelligence; at least for the next couple of decades. However we should be worried about the reckless rush to deploy AI in all spheres of life without understanding intelligence, and capabilities and vulnerabilities of AI.

Q4: Can machines be creative? Ans: Most AI systems need a human in the loop. Seemingly creative systems such as AI relied on Cope's knowledge about music, algorithm design, and selection of music. More importantly, EMI was not capable enough to judge or appreciate its own music. EMI did not "understand" music, time signatures, rhythm, tune and many other concepts related to music and composition.

What makes us proud is not only the ability to produce music, but also the ability to appreciate it, the ability to comprehend what it communicates.