# CCI 是一个强大的工具

The picture shows when our data is 1D the function looks like Sigmoid function. Actually, it is Sigmoid function and it also applys to higher dimension. I won’t prove it here.
GDA is a stricter version of logistic regression because the data has to follow Gaussian distribution.
When the data follows Gaussian CCI 是一个强大的工具 distribution or the data is very big(according to the central limit theorem), GDA works better than logistic regression.
Also, the data follows Gaussian distribution so the model has no local optima.

## Gaussian Discriminative Analysis 高斯判别分析 GDA

​ CCI 是一个强大的工具 = ⎣ ⎢ ⎢ ⎡ ​ μ 1 ​ μ 2 ​ . . . μ n ​ ​ ⎦ ⎥ ⎥ ⎤ ​ – mean vector
Σ \Sigma Σ – covarience matrix
All the Gaussian models share one covarience matrix.

E ( z ) = μ ⃗ , C o v ( z ) = E [ ( x − μ ⃗ ) ( x − μ ⃗ ) T ] = E ( z z T ) − ( E ( z ) ) ( E ( z ) ) T E(z) = \vec\mu, Cov(z)=E[(x-\vec\mu)(x-\vec\mu)^T]=E(zz^T)-(E(z))(E(z))^T E ( z ) = μ

​ , C o v ( z ) = E [ ( x − μ

​ ) T ] = E ( z z T ) − ( E ( z ) ) ( E ( z ) ) T

## Intro

GDA assumes:
x ∣ y = 0 ∼ N ( μ 0 , Σ ) x|y=0 \sim N(CCI 是一个强大的工具 \mu_0,\Sigma) x ∣ y = 0 ∼ N ( μ 0 ​ , Σ )
x ∣ y = 1 CCI 是一个强大的工具 ∼ N ( μ 1 , Σ ) x|y=1 \sim N(\mu_1,\Sigma) x ∣ y = 1 ∼ N ( μ 1 CCI 是一个强大的工具 ​ , Σ )
y ∼ B e r ( ϕ ) , ϕ = P ( y = 1 ) y \sim Ber(\phi), \phi = P(y=1) y ∼ B e r ( ϕ ) , ϕ = P ( y = 1 )

## GDA model(binary classification)

Multivariate Gaussian distribution:
P ( x ) = 1 ( 2 π ) d 2 ∣ Σ ∣ 1 2 e x p ( − 1 2 ( x − μ ) T Σ − 1 ( x − μ ) ) P(x) = \frac<(2\pi)^<\frac d2>|\Sigma|^>exp(-\frac12(x-\mu)^T\Sigma^(x-\mu)) P ( x ) = ( 2 π ) 2 d ​ ∣ Σ ∣ 2 1 ​ CCI 是一个强大的工具 1 ​ e x p ( − 2 1 ​ ( x − μ ) T Σ − 1 ( x − μ ) )
∣ Σ ∣ |\Sigma| ∣ Σ ∣ is the value of determinant of Σ \Sigma Σ

parameter: μ 0 , μ 1 , Σ , ϕ \mu_0,\mu_1, \Sigma, \phi μ 0 ​ , μ 1 ​ , Σ , ϕ
P ( y ) = ϕ y ( 1 − ϕ ) 1 − y P(y) = \phi^y(1-\phi)^ P ( y ) = ϕ y ( 1 − ϕ ) 1 − y
ϕ \phi ϕ is prior probability, and it depends on the proportion CCI 是一个强大的工具 of two classes.

Joint likelihood:
L ( ϕ , μ 0 , μ 1 , Σ ) = ∑ i = 1 m CCI 是一个强大的工具 P ( x ( i ) , y ( i ) ; ϕ , μ 0 , μ 1 , Σ ) = ∑ i = 1 m P ( CCI 是一个强大的工具 x ( i ) ∣ y ( i ) ) P ( y ( i ) ) L(\phi, \mu_0, \mu_1, \Sigma) = \sum\limits_^mP(x^,y^;\phi, \mu_0, \mu_1, \Sigma) = \sum\limits_^mP(x^|y^)P(y^) L ( ϕ , μ 0 ​ , μ 1 ​ , Σ ) = i = 1 ∑ m ​ P ( x ( i ) , y ( i ) ; ϕ , μ 0 ​ , μ 1 ​ , Σ ) = i = 1 ∑ m ​ P ( x ( i ) ∣ y ( i ) ) P ( y ( i ) )
MLE: arg ⁡ max ⁡ ϕ , μ 0 , μ 1 , Σ l ( ϕ , μ 0 , μ 1 , Σ ) \arg\max\limits_<\phi, \mu_0, \mu_1, \Sigma>l(\phi, \mu_0, \mu_1, \Sigma) ar g ϕ , μ 0 ​ , μ 1 ​ , Σ max ​ l ( ϕ , μ 0 ​ , μ 1 ​ , Σ )
ϕ = ∑ i = 1 m y ( i ) m = ∑ i = 1 CCI 是一个强大的工具 m 1 < y ( i ) = 1 >m \phi = \frac<\sum\limits_^my^>=\frac<\sum\limits_^m1\> ϕ = m i = 1 ∑ m ​ y ( i ) ​ = m i = 1 ∑ m ​ 1 < y ( i ) = 1 >​
μ k = ∑ i = 1 m 1 < y ( i ) = k >x ( i ) ∑ i = 1 m 1 < y ( i ) = k >, k ∈ < 0 , 1 >\mu_k = \frac<\sum\limits_^m1\x^><\sum\limits_^m1\>,k\in \ μ k ​ = i = 1 ∑ m ​ 1 < y ( i ) = k >i = 1 ∑ m ​ 1 < y ( i ) = k >x ( i ) ​ , CCI 是一个强大的工具 k ∈ < 0 , 1 >
Σ = 1 m ∑ i = 1 m ( x ( i ) − μ y ( i ) ) ( x ( i ) − μ y ( i ) ) T \Sigma = \frac1m\sum\limits_^m(x^-\mu_)(x^-\mu_)^T Σ = m 1 ​ i = 1 ∑ m ​ ( x ( i ) − μ y ( i ) ​ ) ( x ( i ) − μ y ( i ) CCI 是一个强大的工具 ​ ) T

Based on the two Gaussian models, we can draw a boundary line.

## Prediction

arg ⁡ max ⁡ y P ( y ∣ x ) = arg ⁡ max ⁡ y P ( x ∣ y ) P ( y ) P ( x ) = arg ⁡ max ⁡ y P ( x ∣ y ) P ( y ) \arg\max\limits_yP(y|x) = \arg\max\limits_y \frac=\arg\max\limits_yP(x|y)P(y) ar g y max ​ P ( y ∣ x ) = ar g y max ​ P ( x ) P ( x ∣ y ) P ( y ) ​ = ar g y max ​ P ( x ∣ y ) P ( y )
( P ( x ) P(x) P ( x ) is a constant)

## & Logistic Regression

The picture shows when our data is 1D the function looks like Sigmoid function. Actually, it is Sigmoid function and it also applys to higher dimension. I won’t prove it here.
GDA is a stricter version of logistic regression because the data has to follow Gaussian distribution.
When the data follows Gaussian distribution or the data is very big(CCI 是一个强大的工具 CCI 是一个强大的工具 according to the central limit theorem), GDA works better than logistic regression.
Also, the data follows Gaussian distribution so the model has no local optima.

## CCI 是一个强大的工具

One, I am bored at work and post code. Realize the effect of Android cascading card as shown below!

Second, analyze how to achieve:

Three, preparations:
(1.) First, we complete and display a RecylerView list: the code is as follows *
Create a new SwipeCardBean entity class object to store information:

(2) Write an adapter to display the list information (I believe this will be done. If you don't come, then look at some other people's own practice exercises. I won't write the recylerview_item.xml here!):

(3.) Let's write MainActivity first to try the running effect:

The result after running is as follows:

Fourth, the implementation process
(1.) Looking at this list, which is a normal RecylerView, to display data, how to arbitrarily drag it CCI 是一个强大的工具 and let it move? :
First let's implement arbitrary drag. Here we need to know about ItemTouchHelper:

Let's customize a CallBack class and inherit the ItemTouchHelper.CallBack code as follows: Here we just set the constructor super(0, LEFT|RIGHT|UP|DOWN); to achieve the dragging effect.

The effect diagram is as follows:

(2.) We realize the cascading effect:
we want to achieve the cascading effect, we must first talk about stacking the items together. How do we handle it?
We know that we can control the
display achieve the desired effect. We can see from the class inheritance relationship that LayoutManager is an abstract class, LinearLayoutManager, SwipeCardLayoutManager, and StaggeredCridLayoutManager are implemented with it.
Here we want to achieve the pictures layered together. Then we need to write the LayoutManager class: the code is as follows

generateDefaultLayoutParams() is what we have to write. This method is to create a default LayoutParams for the child View of RecyclerView.

This part of the code is not difficult to understand. You need to draw and analyze it yourself

setTranslationY moves the child View online by the distance.
How many times view.setScaleX zooms in.
For convenience, a CardConfing configuration file is written here.
The configuration file is as follows:

At this time, we can run the effect to see:

How do we solve the loop after removing and removing the last one?
At this time, we go back to the onSwiped() method in the custom SwipeCardCallBack for processing:
we need to delete this data after the finger swipe ends, and then add this data to the lowest end of the collection.
to implement the cycle. Add the code as follows:

At this point, the task is basically completed. The removal loop effect is also implemented. But we don't have animation effects.
We can calculate and set the code in onChildDraw of SwipeCardCallBack as follows:

## CCI 是一个强大的工具

1.Java代码获取

Yes, you can get memory info programmatically and decide whether to do memory intensive work.

Get VM Heap Size by calling: Runtime.getRuntime().totalMemory();

Get Allocated VM Memory by calling: Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();

Get VM Heap Size Limit by calling: Runtime.getRuntime().maxMemory()

Get Native Allocated Memory by calling: Debug.getNativeHeapAllocatedSize();

Using adb, there is a lot of information you can get about the memory use of a running system. A CCI 是一个强大的工具 common one is the command "adb shell dumpsys meminfo" which will spit out a bunch of information about the memory use of each Java process, containing the above info as well as a variety of other things. You can also tack on the name or pid of a single process to see, for example "adb shell dumpsys meminfo system" give me the system process:

The top section is the main one, where "size" is the total size in address space of a particular heap, "allocated" is the kb of actual allocations that heap thinks it has, "free" is the remaining kb free the heap has for additional allocations, and "pss" and "priv dirty" are the same as discussed before specific to pages associated with each of the heaps.

If you just want to look at memory usage across all processes, you can use the command "adb shell procrank". Output of this on the same system looks like:

Here the Vss and Rss columns are basically noise (these are the straight-forward address space and RAM usage of a process, where if you add up the RAM usage across processes you get an ridiculously large number).

Pss is as we've seen before, and Uss is Priv Dirty.

shell dumpsys 会显示以下所有信息。

shell dumpsys activity 显示activity相关的信息

shell dumpsys statusbar 显示状态栏相关的信息

shell dumpsys meminfo $package_name or$pid 使用程序的包名或者进程id显示内存信息

3.使用ddms查看

Dalvik Debug Monitor Server（DDMS）是主要的Android调试工具之一，也是ADT Eclipse plug-in 的一部分，独立的程序版本也可以在Android SDK的根目录下的tools/下面找到。关于DDMS更多的信息，请参考使用DDMS 。

• from Eclipse: click Window > Open Perspective > Other. > DDMS
• or from the command line: run ddms (or ./ddms on Mac/Linux) in the tools/ directory

### 用MAT分析heap dumps

1. 第一个HPROF 文件(using File > Open Heap Dump ).
2. 打开 Histogram view.
4. 打开第二个HPROF 文件然后重做步骤2和3.
5. 切换到Compare Basket view, 然后点击Compare the CCI 是一个强大的工具 Results (视图右上角的红色"!"图标)。

: Eclipse MAT project的官方博客。
• Markus Kohler的Java Performance blog有很多有用的文章, 包括 Analysing the Memory Usage of Android Applications with the Eclipse Memory Analyzer and 10 Useful Tips for the Eclipse Memory Analyzer .

## ขออภัย!

© Valve Corporation สงวนสิทธิ์ทุกประการ เครื่องหมายการค้าทั้งหมดเป็นทรัพย์สินของเจ้าของแต่ละรายในสหรัฐอเมริกาและประเทศอื่น ข้อมูลทางภูมิศาสตร์เชิงพื้นที่บางส่วนบนเว็บไซต์นี้ได้รับมาจาก geonames.org
นโยบายความเป็นส่วนตัว | กฎหมาย | ข้อตกลงการสมัครสมาชิกของ Steam | คุกกี้