摘要: 给一个张量 索引 index0 index1 index2 index3 index0 0 1 2 3 index1 4 5 6 7 index2 8 9 10 11 index3 12 13 14 15 torch.gather(dim, index) → Tensor 首先dim表示维度,如果d 阅读全文
posted @ 2021-08-20 17:34 coderJ_ONE 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 通过三个例子来讲解熵的概念 爸爸需要让小明猜球的颜色,如果猜中了,就停止继续猜,如果没有猜对则一直继续猜。 题目1:爸爸拿来一个箱子,跟小明说:里面有橙、紫、蓝及青四种颜色的小球任意个,各颜色小球的占比不清楚,现在我从中拿出一个小球,你猜我手中的小球是什么颜色? 从上面的图中可以发现,小明首先的假设 阅读全文
posted @ 2021-08-17 14:58 coderJ_ONE 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree root. Split the binary tree into two subtrees by removing 1 edge such that the product of the sums of the subtrees are maximized. 阅读全文
posted @ 2021-03-11 21:22 coderJ_ONE 阅读(76) 评论(0) 推荐(0) 编辑
摘要: Given the root of a binary tree, each node in the tree has a distinct value. After deleting all nodes with a value in to_delete, we are left with a fo 阅读全文
posted @ 2021-03-11 21:11 coderJ_ONE 阅读(68) 评论(0) 推荐(0) 编辑
摘要: Given the root of a binary tree, each node has a value from 0 to 25 representing the letters 'a' to 'z': a value of 0 represents 'a', a value of 1 rep 阅读全文
posted @ 2021-03-11 21:06 coderJ_ONE 阅读(38) 评论(0) 推荐(0) 编辑
摘要: A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles i 阅读全文
posted @ 2021-03-11 20:42 coderJ_ONE 阅读(34) 评论(0) 推荐(0) 编辑
摘要: Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bot 阅读全文
posted @ 2021-03-11 20:16 coderJ_ONE 阅读(41) 评论(0) 推荐(0) 编辑
摘要: Given a reference of a node in a connected undirected graph. Return a deep copy (clone) of the graph. Each node in the graph contains a val (int) and 阅读全文
posted @ 2021-03-11 19:51 coderJ_ONE 阅读(30) 评论(0) 推荐(0) 编辑
摘要: You are given the root of a binary search tree (BST), where exactly two nodes of the tree were swapped by mistake. Recover the tree without changing i 阅读全文
posted @ 2021-03-11 19:42 coderJ_ONE 阅读(34) 评论(0) 推荐(0) 编辑
摘要: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. You may return the answer in any order. Example 1: Input: n 阅读全文
posted @ 2021-03-11 19:23 coderJ_ONE 阅读(31) 评论(0) 推荐(0) 编辑