- 博客(22)
- 资源 (1)
- 收藏
- 关注
原创 Lagrange函数,对偶问题,KKT条件
原始问题约束最优化问题的原始问题:约束最优化问题转化为无约束最优化问题:广义拉格朗日函数(generalized Lagrange function):是是拉格朗日乘子特别要求:原始问题的描述等价为:这个地方如下理解:原始问题最优化:最优值:对偶问题对偶问题:对偶问题一定是凹的。对偶问题最优化(极大值):原始问题最优化(极小值):对偶问题的最优值:...
2018-10-31 10:24:47 2254
转载 熵(Entropy),交叉熵(Cross-Entropy),KL-松散度(KL Divergence),似然(Likelihood)
1.介绍:我们如何去衡量y,y`的接近程度? 在这里我们介绍一下一种衡量方式交叉熵(Cross-Entropy),然后说明一下为什么这种方式适用于分类问题。2.熵(Entropy): 熵的概念来自物理中的热力学,表示热力学系统中的无序程度,我们说的熵是信息论中的熵,表示对不确定性的测量,熵越高,能传输的信息越多,熵越少,传输的信息越少。 也就是我们现在有了观测到的概率分布y,y...
2018-10-30 15:23:27 670
转载 HeapSort
HeapSortHeap sort is a comparison based sorting technique based on Binary Heap data structure. It is similar to selection sort where we first find the maximum element and place the maximum element at...
2018-10-30 13:23:09 453
转载 ShellSort
ShellSortShellSort is mainly a variation of Insertion Sort. In insertion sort, we move elements only one position ahead. When an element has to be moved far ahead, many movements are involved. The id...
2018-10-29 18:06:32 397
原创 Merge Sort with Recursion and Iteration
Merge SortFollowing is a typical recursive implementation of Merge Sort: def mergeSorting(self,arry): def two_part_sort(left,right): result = [] i,j = 0,0...
2018-10-28 23:09:08 274
原创 Iterative Quick Sort
Iterative Quick SortFollowing is an iterative implementation of the above recursive code from geekforgeek:# Python program for implementation of Quicksort # This function is same in both iterative ...
2018-10-28 11:21:47 175
转载 QuickSort
QuickSortLike Merge Sort, QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many different versions of quickS...
2018-10-26 15:26:02 451
转载 Bubble Sort
Bubble SortBubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order.Example:First Pass:( 5 1 4 2 8 ) –> ( 1 5 4 2 8 ), He...
2018-10-26 12:20:44 739
转载 Selection Sort
Selection SortThe selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginning. The algorithm mai...
2018-10-26 11:51:24 155
转载 Insertion Sort
Insertion SortInsertion sort is a simple sorting algorithm that works the way we sort playing cards in our hands.Algorithm// Sort an arr[] of size ninsertionSort(arr, n)Loop from i = 1 to n-1.……...
2018-10-26 11:19:54 430
原创 Binary Tree Traverasl with OO and Stack
Binary Tree Traverasl with OOB and Stack1、一切都是对象,对象就是关系和操作;每个节点,都有两种操作,print和visit。2、放在stack里面可以使操作,可以是函数,递归也是面向对象的体现;Python代码实现如下:class guide(object): def __init__(self, opt,node): s...
2018-10-25 22:51:10 122
转载 Inorder Tree Traversal without Recursion
Inorder Tree Traversal without RecursionUsing Stack is the obvious way to traverse tree without recursion. Below is an algorithm for traversing binary tree using stack. See this for step wise step ex...
2018-10-25 16:52:44 219
转载 Tree Traversals (Inorder, Preorder and Postorder) In Recursive way
Tree Traversals (Inorder, Preorder and Postorder)Unlike linear data structures (Array, Linked List, Queues, Stacks, etc) which have only one logical way to traverse them, trees can be traversed in di...
2018-10-25 16:34:49 376 1
转载 Iterative Preorder Traversal
Iterative Preorder TraversalGiven a Binary Tree, write an iterative function to print Preorder traversal of the given binary tree.Refer this for recursive preorder traversal of Binary Tree. To conve...
2018-10-25 16:19:13 333
转载 Morris traversal for Inorder
Inorder Tree Traversal without recursion and without stack!Using Morris Traversal, we can traverse the tree without using stack and recursion. The idea of Morris Traversal is based on Threaded Binary...
2018-10-25 16:10:16 351
转载 Morris traversal for Preorder
Morris traversal for PreorderMorris traversal for PreorderFollowing is the implementation of the above algorithm.Limitations:Using Morris Traversal, we can traverse the tree without using stack and r...
2018-10-25 15:56:21 250
原创 (python的坑,坑的我头晕,下行循环写后根遍历)
总是提示越界错误IndexError: list index out of range### if s and s[-1].left == t:需要先判断s是否为空,假如:if s[-1].left == t and s就会出现越界。## 边界条件的非常非常重要!!!!## 代码如下:```pythonclass Solution(object): def posto...
2018-10-24 18:23:16 234
原创 WaveNet原理简单理解
WaveNet中重要的概念:因果卷积(causal convolution):因果卷积的意义就是WaveNet在生成t时刻的元素时,只能使用0到t-1时刻的元素值。如下图所示,在WaveNet中利用,output输出只利用了之前的元素来生成。 带洞因果卷积(dialated causal convolutions):整个生成过程的动态图: ...
2018-10-21 20:58:17 3305
转载 Tensorflow保存模型,恢复模型
tensorflow从已经训练好的模型中,恢复(指定)权重(构建新变量、网络)并继续训练(finetuning)https://blog.csdn.net/ying86615791/article/details/76215363 Tensorflow保存模型,恢复模型,使用训练好的模型进行预测和提取中间输出(特征)https://blog.csdn.net/ying8661579...
2018-10-13 09:52:41 147
原创 Error converting shape to a TensorShape: int() argument must be a string or a number, not 'tuple'.
def model_inputs(real_dim, z_dim):# inputs_real = tf.placeholder(tf.float32, (None, *real_dim), name='input_real') inputs_real = tf.placeholder(tf.float32, (None, 32,32,3), name='input_real') ...
2018-10-09 11:01:28 5014
原创 一句话理解tf.identity的含义
tf.identity属于tensorflow中的一个ops,跟x = x + 0.0的性质一样,返回一个tensor,受到tf.control_dependencies的约束,所以生效。
2018-10-02 17:27:06 2041 3
原创 素材的获取
1、音乐素材,可在无授权下使用:http://dust-sounds.com/http://amachamusic.chagasi.com/index.htmlhttps://www.tam-music.com/ 2、向量矢量图素材,可在无授权下使用:https://www.ac-illust.com/https://zh-tw.silhouette-ac.com...
2018-10-01 16:02:37 470 1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人