Terms Probability: The chance of the occurrence of an event Probability Mass: The chance of the occurrence of an random discrete event Probability Density: The probability that a continues event variable is exactly equal to some value Probability Mass Function (PMF): A function which gives the probability that a discrete random variable is exactly equal to some value. Probability Density Function (PDF): A function which gives the probability that a continues random variable is exactly equal to some value.
Diffie-Hellman is commutative, this arithmetic nature denotes that it’s easy to do the exponential calculation in one direction but rather computationally expensive in reverse.
Network Overview Assume that we have a typical testbed looks like this:
The testbed is initially configured so that the clients (IoT devices) in each customer’s network access a local server. Your goal is to relocate the server functionality from the customers’ local networks to a cloud platform, which is represented by the network on the right-hand side. The Router in the above topology represents routing across the Internet between the customer sites and the cloud.
Learning Diary 2 1 Abstract In metabolite analysis, we are trying to study and annotate different molecules by their features. However, small molecules typically contain similar structures and the space of potential structures is tremendous (over 600 million). The amount of unique spectra covers only a small fraction of the entire database.
With the input out of the LC-MS^2 process, the machine learning algorithm runs like a search engine that assigns ranked scores to predicted structures of high similarities.
Abstract According to practical experience and medical treatment records, it shows that combinations of multiple drugs may positively effect the curing process regarding to certain disease. People are investigating about the effectiveness of the drug combinations with certian dosage against senarios when used respectively. However, the number of potencial combinations may grow exponentially when try to add more medicines into consideration, this refers as combinatorial explosion. Hence, we need to prioritize and reduce ranks for the search for combinations, whereas certrain machine learning methods can contribute.
1 Defination of convolution The mathmatical format of convolution is
Continuous: $ Conv(x) = \int f(x-\alpha)t(\alpha)d\alpha $ Discreate: $ Conv(x)=\sum_{\alpha} f(x-\alpha)t(\alpha) $ Matrix: $ Conv(x) = (f * t)(x) $, where * represents the convolution process 2 Convolution Neural Network 2.1 Convolutional layer Terms W: width or height of the input matrix (输入的长度或宽度) F: receptive field (感受野) S: stride(步幅) P: zero-padding (补零的数量) K: depth of the output (深度,输出单元的深度) The output shape of after a convolution process follows: $$\frac{S}{W-F+2P} + 1$$
Gradient descent update rule $$ W^{[l]} = W^{[l]} - \alpha \text{ } dW^{[l]}\tag{1} $$
$$ b^{[l]} = b^{[l]} - \alpha \text{ } db^{[l]}\tag{2} $$
where L is the number of layers and αα is the learning rate. All parameters should be stored in the parameters dictionary.
Note that the iterator l starts at 0 in the for loop while the first parameters are W[1] and b[1].
You need to shift l to l+1 when coding.
1 Information Content 1.1 Defination In information theory, the information content, self-information, surprisal, or Shannon information is a basic quantity derived from the probability of a particular event occurring from a random variable.
The information content tells how much information is given.
1.2 Function The function of information content need to comply with both constraints: $$f(x) = \sum_{1}^{i} I(p_i)$$ $$x = \prod_{1}^{i} p_i$$
As a result, the function can be described as:
Random Walk Given a graph, a random walk is an iterative process that starts from a random vertex, and at each step, either follows a random outgoing edge of the current vertex or jumps to a random vertex. The jump part is important because some vertices may not have any outgoing edges so a walk will terminate at those places without jumping to another vertex.
Page Rank (PR) measures stationary distribution of one specific kind of random walk that starts from a random vertex and in each iteration, with a predefined probability p, jumps to a random vertex, and with probability1-p follows a random outgoing edge of the current vertex.
type和object的关系 一句话简述:types是objects的一个子类,objects是type的一个实例。在Python的世界中,object是类父子关系的顶端,所有的数据类型的父类都是它;type是类型实例关系的顶端,所有对象都是它的实例。它们两个的关系可以这样描述:
白板上的第一列,目前只有type,我们先把这列的东西叫Type。 白板上的第二列,它们既是第三列的类型,又是第一列的实例,我们把这列的对象叫TypeObject。 白板上的第三列,它们是第二列类型的实例,而没有父类(__bases__)的,我们把它们叫Instance。 详见知乎:jeff kit
metaclass metaclass常被用来在类实例化前做一些动态更改类属性的事情,比如,依赖于自省,控制继承等等。它的作用简而言之为:
中断类的默认创建 修改类属性,方法等 返回修改后的类 metaclass继承自type,是类的类。 以下是一个最简单的metaclass例子
class MyMetaclass(type): def __new__(cls, name: str, bases: set, attrs: dict) -> type: # some custom process attrs_processed = {} for name, val in attrs.items(): if not name.startswith('__'): uppercase_attr[name.upper()] = val else: uppercase_attr[name] = val return super().__new__(cls, name, bases, attrs_processed) metaclass的一个主要用途就是构建API。Django(一个python写的web框架)的ORM就是一个例子。
用Django先定义了以下Model:
class Person(models.Model): name = models.CharField(max_length=30) age = models.IntegerField() 然后执行下面代码:
guy = Person.objects.get(name='bob') print guy.age # result is 35 这里打印的输出并不是IntegerField,而是一个int,int是从数据库中获取的。 这是因为models.
Basic concepts Linear Transformation A matrix can be seen as a linear transforamtion, for which the most important factors are the speed and direction:
Eigenvalue is the velocity Eigenvector is the direction Rank The rank of the matrix represents the dimension. It also indicates the number of the eigenvectors (linear independent base vectors) of the transformation.
Eigenvectors and Eigenvalue Matrix $A$ is a linear transformation, and it can be represents as follows: