从文档中我认为有一个构造函数采用NetParameter参数,
explicit Net(const NetParameter¶m);
但是当我尝试使用它时:
import caffe
from caffe import layers as L
from google.protobuf import text_format
def logreg(hdf5, batch_size):
# logistic regression: data, matrix multiplication, and 2-class softmax loss
n = caffe.NetSpec()
n.data, n.label = L.HDF5Data(batch_size=batch_size, source=hdf5, ntop=2)
n.ip1 = L.InnerProduct(n.data, num_output=2, weight_filler=dict(type='xavier'))
n.accuracy = L.Accuracy(n.ip1, n.label)
n.loss = L.SoftmaxWithLoss(n.ip1, n.label)
return n.to_proto()
logreg_str = str(logreg('examples/hdf5_classification/data/test.txt', 10))
net_param = caffe.proto.caffe_pb2.NetParameter()
_ = text_format.Merge(logreg_str, net_param)
print type(net_param);
caffe.Net(net_param, caffe.TEST)
Run Code Online (Sandbox Code Playgroud)
ipython中出现以下错误
<class 'caffe.proto.caffe_pb2.NetParameter'>
---------------------------------------------------------------------------
ArgumentError Traceback (most recent call …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用这种递归SQL功能,但无法让它做我想要的,甚至不能关闭.我在一个展开的循环中编写了逻辑,询问它是否可以转换为单个递归SQL查询,而不是我使用的表更新样式.
http://sqlfiddle.com/#!4/b7217/1
有六名球员排名.他们有id,组ID,分数和排名.
初始状态
+----+--------+-------+--------+
| id | grp_id | score | rank |
+----+--------+-------+--------+
| 1 | 1 | 100 | (null) |
| 2 | 1 | 90 | (null) |
| 3 | 1 | 70 | (null) |
| 4 | 2 | 95 | (null) |
| 5 | 2 | 70 | (null) |
| 6 | 2 | 60 | (null) |
+----+--------+-------+--------+
Run Code Online (Sandbox Code Playgroud)
我想把初始得分最高的人给他们排名1.然后我将10点奖励积分给每个拥有相同组ID的人的得分.取下一个最高,分配等级2,分配奖励积分等等,直到没有玩家离开.
用户ID打破了关系.
奖励积分会改变排名.id = 4最初看起来是第二位置95,在领先者后面有100但是有10点奖金,id = 2向上移动并取得现场.
最终状态
+-----+---------+--------+------+
| …
Run Code Online (Sandbox Code Playgroud) 我有一个包含10个项目的数据框,我想否定偶数行.我想出了这个怪物:
change_even <- data.frame(val=runif(10))
change_even$val[row( as.matrix(change_even[,'val']) ) %% 2 == 0 ] <- -change_even$val[row( as.matrix(change_even[,'val']) ) %% 2 == 0 ]
Run Code Online (Sandbox Code Playgroud)
有没有更好的办法?
Oracle 12c 12.1.0.2,SQL Developer 4.1.3.20
按照在线教程安装了 ORDS(无 APEX)并且自动启用功能工作正常,包括 POST 到启用的 (emp) 表,因此环境看起来不错。但是当我尝试在 POST 中定义 PL/SQL 服务时,我似乎无处可去。这是服务定义:
-- ORDS has been started in Standalone mode in SQL developer here
CREATE OR REPLACE PROCEDURE test_proc IS
BEGIN
INSERT INTO emp (empno, ename) VALUES (10, 'TEST');
END test_proc;
/
BEGIN
ORDS.DEFINE_SERVICE(
p_module_name => 'test' ,
p_base_path => 'test/',
p_pattern => 'simple_insert/',
p_method => 'POST',
p_source_type => ords.source_type_plsql,
p_source => 'BEGIN
hr.test_proc;
END;');
COMMIT;
END;
/
-- At this point the service is defined …
Run Code Online (Sandbox Code Playgroud)