Why believe the machines ?


We trust God, Men and Machine should bring data. 

Sometimes statistics can be another way to tell lieLook at this example: Death rate is low among group of solders compare to city population. It does not mean, all should join military for having longer life. Solders are healthy young population, while city population includes all age group and all health condition people. 

Does machine lies? 
Machine does not lie on its own. However, one makes machine to lie us unconsciously by
  1. Accepting poorly-specified models
  2. Improperly combining different generes of models 
  3. Using biased data

Such models work very well on training data and test data with respect to certain metrics. So people believe those models.

Importance of accuracy
We does not care about incorrectness by machine learning algorithm for image recognition, recommendation system, super accurate OCRs etc. 
However, all people are sensitive to incorrectness by machine learning algorithms at medical diagnostics, financial fraud detection, autonomous car. 

Explain
So machine learning algorithms should also explain the rational behind proposed solution/answer, same like human beings. Google map already explains rational behind best suggested route, with traffic jam indications. 

The benefits of such explanations are enormous. At some of the countries it is enforced by law, that machine learning algorithms must provide rational and justification. It provides more insight to the domain. So it helps: 
  1. To detect unconscious bias in data and incorrect logic. For example: one image recognition algorithm incorrectly classified the image based on background. 
  2. To provide gut feeling and intuitive sense of data
  3. To learn : novel mechanism, cause of effects, better processes to solve the problem. For example: (1) Doctor job is easier, if machine learning algorithm explains the rational along with diagnostics and recommendations (2) Player can learn how to play Alpha-go game in better way, if the algorithm explains the move. 
  4. People trust more the model
  5. Humans and machine can work as a team 
Machine Learning Algorithm Classifications
Now let's classify the machine learning algorithms as per their capability to provide the explanation. 

  1. White box algorithms with high interpretablity and low accuracy. Examples: Regression, Decision Tree, Association Rule Mining, Linear SVMs
  2. Grey box algorithms. Examplaes: Clustering, Bayesian Nets, Genetics algorithms, Logic programming
  3. Black Box algorithms. Examples : DNN, Non-linear matrix factorisation, non-linear dimensionality reduction
Implementation


Layer wise Relevance Propagation (LRP) is useful technique for DNN to get more insight. In this technique backward propagation is used to highlight, which neuron is contributing to final output. At the end it highlight the input features who are contributing more to the final decision. 

However, it is computationally expensive. As an alternative "Locally Interpretative Surrogate Model" can be used, that closely mimic the actual model. 

Reference: 

A talk by Dr. Vikas Agrwal from "Oracle Analytics Cloud" on the topic "Why believe the machines ?". It was "Developer Connect" event on Machine Learning and Artificial Intelligence, at Bangalore India by NVIDIA. Please refer  https://drive.google.com/drive/folders/1-er_ORBUGr37dmM2owujO821_l1BmwC9?usp=sharing Folder : DC_Bangalore 5th Video "Dr. Vikas Agrwal.mp4" from 3:05 to 48:40 

Note: 
This blog post is not verbatim of Dr. Vijas's speech. The text describe above is as per my own understanding of discussion at the venue, that may not be fully correct. Any comments, suggestions, additions, modifications, corrections are welcome. 

My Python Notes


Everything is object, including class
Everything has namespace
Everything can be printed / retrospected
Functions are first class object

In Python values carries types
In Python variables do not carry types

Variables means refernce to object
Always object reference is passed to function

PyPy : Run time environment

Python supports
* Multiple inheritence
* mixins
* extensive introspection of type and class
* operator overloading with special member function
* complex numbers
* limited support to lambda

Modules

Module = Statements + Definitions
Few important modules are: 
OS : System calls. enviorn for env variables like $HOME. it is dictionary.
sys : to get argv. e.g. sys.argv[1:] because argv[0] is programe name
string, regex, collections, heapq, array, enum, etc. 
numbers, decimals and  fractions : For extra numeric types

Type conversion:
Moderatly type checked language
Implicit conversion for numeric types
No implicit conversion between string and number

Switch = if ... elif ... elif ... else




* Base Types
String is immutable. So replacing a char, returns new String object. 

* Collection (container) Types

Objects can be easily refernced or indexed

A. Sequence : ordered type

1. String = immutable 

String Format

print("I just printed %s pages to the printer %s" % (num, printer))
print("I just printed {0} pages to the printer {1}".format(num, printer))
print("I just printed {num} pages to the printer {printer}".format(num=num, printer=printer))
print(f"I just printed {num} pages to the printer {printer}")

""" OR ''' are used for multiline string

space, coma and newline are default delimiter used in split
x = input("Prompt message"). here x will be always string. 

2. Lists = mutable, dynamic array. 

List has in-build functions like : sort, len, append(one member), remove (value is argument), To delete entry from list at specific index, use : "del list[index]". insert, extend (list), index, pop = pop(-1) (index is argument), no push function.   
List declaration: a_list = [1, 2, "asdf"] OR a_list = list()
comprehension is like lembda function.
primes = [2] 
e.g. list2 = [x ** 2 for x in list1]
Here primes is list with member 2

3. Tuples = immutable.

Tuple declaration: a_tuple = 1, 2, "asdf" OR a_tuple = (1, 2, "asdf")
Tuples are also good for storing closely related data. For example, (x, y, z) coordinates or (r, g, b) colour components

B. Mapping : un-ordered type

1. Dictionaries = Associative Array. Keys are immutable. So String and Tuples can be keys.
Dictionary declaration: dict = {k1:v1, k2:v2}
Useful for JSON objects. 
Dictionary has built-in functions like : has_key(key), get(key, 'optional unknown'), keys, values, del dict['key'], update function will merge the value part: if key found then change value else add the pair. 

one can get list containing keys from dictionary. a_list = list(a_dict)

2. Set : no duplicate. no order, 
Set declaration : a_set = {0, (), "asdf", False}
Set has built-in functions like  : union |, intersection &, difference, symmetric difference -, union - intersection = ^, and subset testing

x = {} This is empty dic not empty set. 

3. Frozenset : immutable set

To iterate through all collection, one can use: 
for item in
The built-in function type() allows us to obtain the type of any object.


Python code compilation to : 

1. CPython : code -> Python byte code
2. Jython : code -> Java Byte Code
3. IronPython : code -> IL(.NET) Byte code

Variable scope

1. local scope
2. global scope
3. built-in scope


Comparison
* string, number, sequence, map all can be compared
* a < b < c = (a < b) && (b < c)


The core built-in types for manipulating binary data are bytes and bytearray. They are supported by memoryview, which uses the buffer protocol to access the memory of other binary objects without needing to make a copy.

Reference:
https://devopedia.org/python-data-structures

Cloud Native Landscape



5G NR : Part 1


5G is about IoT. In fact in 4G also, IoT related standardization was started with NB-IoT. 

Use Cases

  1. AR/VR
  2. Autonomous transportation (car)
  3. Reliable access to remote health-care
  4. Public safety
  5. Smarter Agriculture
  6. Efficient use of energy/utilities
  7. Autonomous manufacturing
  8. Sustainable cities and infrastructure 
  9. Digitized logistics and retails
Verticals

Avalanche of traffic volumeMassive connected devicesDiversified use cases
Autonomous car
Connectivity Req
Peak data rate 10Gbps
Min data rate 50 Mbps
High user mobility
Brodband access in dense area
Connectivity Req
Low cost
Low energy
Low packet size
Connectivity Req
Ultra high reliability
Ultra low latency
Use cases
Ultra large volume transfer
Always connected in crowd
AR / VR
Use Cases
IoT
IIoT
Use cases
V2V communication
Driver-less car
Remote surgery
Smart grid
Manufacturing Robot

Market Segments

1. Enhanced Mobile Broadband (eMBB)
2. Massive Machine Type Communications (eMTC)
3. Ultra Reliable and Low Latency Communications (URLLC)

Key KPIs

1. Peak data rate
2. Spectrum efficiency
3. Mobility
4. Latency
5. Connection diversity
6. Network energy efficiency
7. Area traffic capacity

5G standard bodies

1. 3GPP (ITU-R) : (IMT 2020)
2. EU - (METIS - 2020) 
3.1 Japan 2020 and beyond
3.2 Korea 5G Forum
3.3 MOST - China

5G Evolution

1. IMT-Advanced
2. Enhanced IMT-Advanced
3. 5G RAN

Peak data rate
Mobility
Capacity (/km square)
Number of connected devices / cell
User plane latency
Energy Saving (energy / bit)

5G Standards

3GPP 5G NR Specification
Verizon 5G Specification
Phy channels and modulation38.211 : NRTS V5G.211
Multiplexing and channel coding38.212 : NRTS V5G.212
Physical layer procedures38.213 : NRTS V5G.213
URLhttp://www.3gpp.org/DynaReport/38-series.htmhttp://www.5gtf.net/


pre 5G standard - https://m.corp.kt.com/eng/html/biz/services/sig.html


3GPP Important Standards

TS 38.211 NR; Physical channels and modulation  
TS 38.212 NR; Multiplexing and channel coding  
TS 38.213 NR; Physical layer procedures for control  
TS 38.214 NR; Physical layer procedures for data  
TS 38.215 NR; Physical layer measurements  
TS 38.300 NR; Overall description; Stage-2  
TS 38.321 NR; Medium Access Control (MAC) protocol specification  
TS 38.322 NR; Radio Link Control (RLC) protocol specification  
TS 38.323 NR; Packet Data Convergence Protocol (PDCP) specification  
TS 38.331 NR; Radio Resource Control (RRC); Protocol specification
TR 38.801 Study on new radio access technology: Radio access architecture and interfaces
TR 38.912 Study on new radio access technology  

TR 38.913 Study on scenarios and requirements for next generation access technologies
TS 23.501 System Architecture for the 5G System

NSA

gNB to EPC

SA

gNB to 5G CN
For greenfield deployment

4G and 5G comparison 

4G
5G
eNBgNB
Key Functions:
1. Intercell Radio Resource Management
2. Resouce Block Control 
3. Radio Admission Control
4. Connection Mobility Control
5. Dynamic Resource Allocation (Scheduler)
6. Measurement Configuration and Provisioning
X2 InterfaceXn Interface
MMEAMF : Access & Mobility Management F
Key Functions:
1. NAS Security 
2. Idle State Mobility Handling
S-GWUPF : User Plane F
Key Functions:
1. Mobility Anchroing 
2. PDU Handling
P-GWSMF : Session Management F
Key Functions:
1. UE IP Address Allocation 
2. PDU Session Control.
S1-CNG-C
S1-UNG-U
EPC5G CN = NGC

U-Plane

New protocol SDAP over existing PDCP

Deployment Models


ModelFyBW
Indoor Hotspot30 GHzUpto 1 GHz
Rural700 MHzUpto 20 MHz
High Speed4 GHzUpto 200 MHz
Urban + Massive Connections700 MHz OR
Optionally 2100 MHz

Reference : TR 38.913 Study on scenarios and requirements for next generation access technologies

mmWave frequency is > 30 GHz

5G New Technology

1. mmWave frequency is > 30 GHz
2. Massive MIMO > 8 x 8 MIMO
3. Beam Management
4. LDPC coding (for U-Plane) and Polar coding (for C-Plane) 
5. AS Layer
6. UL Waveform
7. Subframe structure
8. HARQ
9. SDN
10. NFV
11. Grant-free UL for IoT

Numerologies

1 frame = 10 subframe
1 subframe's slot = f (n)
1 slot = 14 symbols

So 1 frame's slot = 10 x f(n)
So 1 subframe's symbols = 14 x f(n)
So 1 frame's symbol = 10 x 14 x f(n) = 140 x f(n)


Numerology
Sub carrier BW (kHz)
Delta F = 2 ** n x 15
12 x Delta F
Remark
Slot / subframe
Slot / frame
Symbol / subframe
Symbol / frame
0
15
180 kHz
Below 1GHz
1 GHz to 6 GHz
1
10
14
140
1
30
360 kHz
Below 1GHz
1 GHz to 6 GHz
2
20
28
280
2
60
729 kHz
1 GHz to 6 GHz
24 GHz to 52.6 GHz
4
40
56
560
3
120
1.44 MHz
24 GHz to 52.6 GHz
8
80
112
1120
4
240
2.88 MHz
16
160
224
2240
5
380
5.76 MHz
32
320
448
4480


Slot Format

TDD or FDD depends upon

0 : All 14 Symbols are D
1 : All 14 Symbols are U
2 : X
3 : 13 D + 1 X
4:  12 D + 2 X
5 : 11 D + 3 X

D = Downlink
U = Uplink
X = Flexible

To be continued...

AWS


As per Wikipedia Amazon has about 90+ cloud services. Here is list of all major services

90 services 
Computing
Amazon Elastic Compute Cloud (EC2) : IaaS
Amazon Elastic Beanstalk (ESB) : PaaS
Amazon Lambda : FaaS
Networking
Amazon Route 53
Amazon Virtual Private Cloud (VPC)
AWS Direct Connect
Amazon Elastic Load Balancing (ELB)
AWS Elastic Network Adapter (ENA)
Content Delivery
Amazon CloudFront : CDN
Contact Center
Amazon Connect
Storage and content delivery
Amazon Simple Storage Service (S3) : Object storage
Amazon Glacier : For archiving data
AWS Storage Gateway : iSCSI
Amazon Elastic Block Store (EBS) : block level storage
AWS Import/Export
Amazon Elastic File System (EFS)
Database
Amazon DynamoDB : NoSQL
Amazon Elastic Cache : Like Memcached and Redis
Amazon Relational Database Service (RDS) : MySQL, Oracle, SQL Server, PostgreSQL
Amazon Redshift : column based
Amazon SimpleDB
AWS Data Pipeline
Amazon Aurora : MySQL
Mobile services 
AWS Mobile Hub : Add/Configure features for mobile apps
Amazon Cognito : Singup / signin
AWS Device Farm : Testing
Amazon Pinpoint : email/SMS/push notofication and tracking customer activity
Deployment
AWS CloudFormation : IaaC to configure cloud
Amazon Elastic Beanstalk (ESB) : PaaS
AWS OpsWorks : Configure EC2 using Chef
AWS CodeDeploy
Management
AWS System Manager 
Amazon Indentity and Access Management (IAM) : Implicit Service
AWS Directory Service
Amazon CloudWatch
AWS Management Console (AWS Console)
Amazon CloudHSM (Hardware Security Module)
AWS Key Management Service (KMS)
Amazon EC2 Container Service (ECS)
Application services
Amazon API Gateway
Amazon CloudSearch
Amazon DevPay
Amazon Elastic Transcoder (ETS) : S3 hosted videos transcoding for mobile
Amazon Simple Email Service (SES)
Amazon Simple Queue Service (SQS)
Amazon Simple Notification Service (SNS)
Amazon Simple Workflow (SWF)
Amazon Cognito
Amazon AppStream 
Analytics 
Amazon Athena : Serverless query to S3 content
Amazon Elastic MapReduce (EMR) : PaaS
Amazon Machine Learning
Amazon Kinesis : like Apache Kafka
Amazon Elastic Search : elastic search and Kibana
Amazon QuickSight
Amazon Sagemaker : Deep Learning. Build, train and deploy Machine Learning models
Miscellaneous
Amazon Marketplace Web Service (MWS)
Amazon Mechanical Turk (Mturk)
Amazon Product Advertising API : old names (1) Amazon Associate Web Service (A2S) + (2) Amazon E-commerce Service (ECS)
Amazon Gift Code on Demand (AGCOD) : For corporate customer
AWS Partner Network (APN)
Amazon Lumberyard : Game engine 
Amazon Chime : Colloborative service for video, conf. and IM. 
Amazon Autoscaling
Machine Learning
AWS DeepLens : Computer vision and deep learning
Amazon Comprehand : NLP
Amazon Rekognition Video
Amazon Sagemaker : Deep Learning. Build, train and deploy Machine Learning models
Amazon translate
Amazon Transcribe
Developer tools

AWS Cloud9 : cloud IDE