小编mac*_*guy的帖子

Haskell树分裂:有人可以解释一下这行吗?

split s (Root x lst rst)
 | s < x = let (nlt, nrt) = split s lst in
     (nlt, Root x nrt rst)
Run Code Online (Sandbox Code Playgroud)

有人可以解释这一行吗?我真的没有得到这个let部分.

我试着想一想,我不知道我是否做对了:我们绑定(nlt, nrt),结果split s lst; 而且split s lst本身就是(nlt, Root x nrt rst)

是吗?

这是完整的代码:

split :: Ord a => a -> Tree a -> (Tree a, Tree a)
split _ Empty = (Empty, Empty)
split s (Root x lst rst)
 | s < x = let (nlt, …
Run Code Online (Sandbox Code Playgroud)

haskell

19
推荐指数
1
解决办法
670
查看次数

4步交替RPN /更快的R-CNN培训?-Tensorflow对象检测模型

正在经历最近发布的tensorflow / models ../ object_detection模型,特别是更快的r-cnn。

本文提到了4步交替训练,

  1. 训练RPN,然后冻结RPN层,
  2. 训练RCNN,然后冻结RCNN层,
  3. 训练RPN,然后冻结RPN层
  4. 训练RCNN。

根据我的收集,在阶段2 = RCNN中,RPN确实冻结了:

if self._is_training:
    proposal_boxes = tf.stop_gradient(proposal_boxes) 
Run Code Online (Sandbox Code Playgroud)

因此,涵盖了培训RPN +冻结RPN层,然后进行RCNN培训,但是其他3个步骤又在哪里执行?

我想念什么吗?

object-detection tensorflow

2
推荐指数
1
解决办法
1868
查看次数

C++ - 在删除堆上分配的任务数组时,添加列表<Task> l(或任何STL Container)作为数据成员会导致错误

我有一个叫做Task的课.头文件如下:

class Task
{
public:
    Task();
//Methods Declarations

private:

int uid;
list<Task> l;

    friend ostream & operator<<(ostream & os, const Task &t);
    friend ostream & operator<<(ostream & os, const list<Task *> &l);
};
Run Code Online (Sandbox Code Playgroud)

现在在我的主文件中,我运行:

Task * tasks[7];
for (int i = 0; i != 7; ++i)
    tasks[i] = new Task();

delete [] *tasks;
Run Code Online (Sandbox Code Playgroud)

在运行时,delete[] *tasks;我收到以下错误消息:

Assignment 4(23901) malloc: *** error for object 0x1001009f8: pointer being 
                                freed was not allocated *** set a breakpoint in 
                                malloc_error_break to debug
Run Code Online (Sandbox Code Playgroud)

一旦我注释掉 …

c++ memory debugging pointers

0
推荐指数
1
解决办法
112
查看次数