axis

Keras MAE和MSE source code

╄→尐↘猪︶ㄣ 提交于 2019-12-01 19:39:55
def mean_squared_error(y_true, y_pred): if not K.is_tensor(y_pred): y_pred = K.constant(y_pred) y_true = K.cast(y_true, y_pred.dtype) return K.mean(K.square(y_pred - y_true), axis=-1) def mean_absolute_error(y_true, y_pred): if not K.is_tensor(y_pred): y_pred = K.constant(y_pred) y_true = K.cast(y_true, y_pred.dtype) return K.mean(K.abs(y_pred - y_true), axis=-1) def mean_absolute_percentage_error(y_true, y_pred): if not K.is_tensor(y_pred): y_pred = K.constant(y_pred) y_true = K.cast(y_true, y_pred.dtype) diff = K.abs((y_true - y_pred) / K.clip(K.abs(y_true), K.epsilon(), None)) return 100. *

Difference between Axis and Axis2 to develop Web Service

做~自己de王妃 提交于 2019-12-01 17:31:16
问题 In my project, I will have to develop a some data in/out interfaces based on Web Service technology. So until now I have studied about it. What I am curious about Web Service with Java is what library I can use or not. As I searched java library, I found that Axis2 and CXF are very common and famous java w/s library. The problem is I have to use RAD 7.0 which contains axis. It seems there are huge change between Axis and Axis2 and unfortunately I can't use Axis2. Now, my partner provides WSDL

Pandas处理缺失的数据

我的梦境 提交于 2019-12-01 16:29:48
处理丢失数据 有两种丢失数据: None np.nan(NaN) import numpy as np import pandas from pandas import DataFrame 1. None None是Python自带的,其类型为python object。因此,None不能参与到任何计算中。 # 查看None的数据类型 type(None) NoneType 2. np.nan(NaN) np.nan是浮点类型,能参与到计算中。但计算的结果总是NaN。 # 查看np.nan的数据类型 type(np.nan) float 3. pandas中的None与NaN 创建DataFrame df = DataFrame(data=np.random.randint(0,100,size=(10,8))) df */ /*--> */ 0 1 2 3 4 5 6 7 0 22 13 16 41 81 7 25 86 1 23 3 57 20 4 58 69 40 2 35 81 80 63 53 43 20 35 3 40 14 48 89 34 4 64 46 4 36 14 62 30 80 99 88 59 5 9 98 83 81 69 46 39 7 6 55 88 81 75 35 44 27 64 7 14 74 24 3 54 99 75 53 8 24

JFreeChart - how to reverse axis order

China☆狼群 提交于 2019-12-01 16:06:29
问题 I'm creating XYPlot and I need to reverse the order on y-Axis (that is, I need lower numbers to be higher on the axis). I would appreciate any hints how to do that. 回答1: I had the same problem as you. I found this: ChartPanel.getChart().getXYPlot().getRangeAxis().setInverted(boolean) 回答2: to reverse the Y-axis ... you can use ChartPanel.getChart().getXYPlot().getDomainAxis().setInverted(boolean) Source: Reverse X-axis numeric labels in JFreeChart 来源: https://stackoverflow.com/questions

WSDL2Java Throws Could not find main class: org.apache.axis.wsdl.WSDL2Java

邮差的信 提交于 2019-12-01 15:27:54
I am trying to create the java files from a remote webservice. I downloaded axis 1.4, copied the lib folder to c:\data\axis\lib which contains of these files: axis.jar axis-ant.jar commons-discovery-0.2.jar commons-logging-1.0.4.jar jaxrpc.jar log4j.properties log4j-1.2.8.jar saaj.jar wsdl4j-1.5.1.jar I added the c:\data\axis\lib folder to the %AXISCLASSPATH%. Now I am trying to create the java classes using this cmd: java -cp %AXISCLASSPATH% org.apache.wsdl.WSDL2JAVA http://myurl.com?wsdl However I keep getting this error message: Exception in thread "main" java.lang.NoClassDefFoundError: org

caffe中softmax源码阅读

偶尔善良 提交于 2019-12-01 15:24:51
(1) softmax函数              (1) 其中,z j 是softmax层的bottom输入, f(z j )是softmax层的top输出,C为该层的channel数。 (2) softmax_layer.cpp中的Reshape函数: 1 template <typename Dtype> 2 void SoftmaxLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom, //bottom blob为softmax层的输入,top blob为该层输出。 3 const vector<Blob<Dtype>*>& top) { 4 softmax_axis_ = //softmax_axis_为1 5 bottom[0]->CanonicalAxisIndex(this->layer_param_.softmax_param().axis()); 6 top[0]->ReshapeLike(*bottom[0]); //使用bttom[0]的shape和值去初始化top[0],后面所有的操作基于top[0]   //bottom[0]的shape为[N, C, H, W], bottom[0]->shape(softmax_axis_)的值为C 7 vector<int> mult_dims(1,

Custom x-axis values in a matlab plot

∥☆過路亽.° 提交于 2019-12-01 15:23:27
问题 Currently when I plot a 9 by 6 array, the x-axis of the figure is just 1, 2, 3 up to 9. The Y-axis shows the correct values. Instead of 1 to 9 I would like the x-axis values to be custom. They should be 100 200 400 1000 2000 5000 10000 20000 50000 instead. I tried set(gca,'XTick', [100 200 400 1000 2000 5000 10000 20000 50000]) But that's not the correct way to do it. Is there a Matlab option to have these custom values for the x-axis? Why is Matlab just using 1 to 9 anyway? 回答1: You should

Numpy的基础使用

我只是一个虾纸丫 提交于 2019-12-01 13:24:25
数据分析: 是把隐藏在一些看似杂乱无章的数据背后的信息提取出来,总结出所研究对象的内在规律 数据分析的三剑客: Numpy, Pandas, Matplotlib NumPy(Numerical Python) 是 Python 语言的一个扩展程序库,支持大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库。 一, 创建ndarry 使用np.array()创建 import numpy as np # 约定使用np np.array([1, 2, 3, 4, 5]) # 一维数组 array([1, 2, 3, 4, 5]) np.array([[1, 2], [1, 2]]) # 二维数组 array([[1, 2], [1, 2]]) np.array([[1, 'two'], [1, 2.3]]) array([['1', 'two'], ['1', '2.3']], dtype='<U11') 注意: numpy默认ndarray的所有元素的类型是相同的 如果传进来的列表中包含不同的类型,则自动统一为同一类型,优先级:str>float>int 使用案例: 使用matplotlib.pyplot获取一个numpy数组,数据来源于一张图片 import matplotlib.pyplot as plt # 约定使用plt img_arr = plt.imread

关于tensorflow的规约函数

烈酒焚心 提交于 2019-12-01 13:24:06
规约函数都有降维的功能,每个函数都有维度线(axis) ,如果不指定,那么他的默认参数是None,就是把这个张量(tensor)降到0维度,也就是一个数。 规约函数如下: 函数 描述 reduce_sum ( input_tensor , axis = None , keep_dims = False , name = None , reduction_indices = None) 计算输入张量元素的和,或者按照axis指定的轴进行求和 reduce_prod(input_tensor,axis=None,keep_dims=False,name=None,reduction_indices=None) 计算输入张量元素的乘积,或者按照axis指定的轴进行乘积 reduce_mix(input_tensor,axis=None,keep_dims=False,name=None,reduction_indices=None) 计算输入张量元素的最小值 reduce_max(input_tensor,axis=None,keep_dims=False,name=None,reduction_indices=None) 计算输入张量元素的最大值 reduce_mean(input_tensor,axis=None,keep_dims=False,name=None,reduction

数据分析三剑客

China☆狼群 提交于 2019-12-01 12:42:47
数据分析三剑客:   Numpy,Pandas,Matplotlib NumPy   NumPy(Numerical Python) 是 Python 语言的一个扩展程序库,支持大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库。 一、创建ndarray 1. 使用np.array()创建   一维数据创建 import numpy as np arr = np.array([1,2,3,4,5]) arr #结果 array([1, 2, 3, 4, 5])   二维数据创建 import numpy as np arr = np.array([[1,2,3],[4,5,6]]) arr #结果 array([[1, 2, 3], [4, 5, 6]]) 元素类型相同 arr = np.array([[1,2,3],[4,5.123,6]]) arr # 结果 array([[1. , 2. , 3. ], [4. , 5.123, 6. ]]) 注意: numpy默认ndarray的所有元素的类型是相同的 如果传进来的列表中包含不同的类型,则统一为同一类型,优先级:str>float>int 使用matplotlib.pyplot获取一个numpy数组,数据来源于一张图片 图片 import matplotlib.pyplot as plt img_arr =