为了训练神经网络,我修改了在 YouTube 上找到的代码。它看起来如下:
def data_generator(samples, batch_size, shuffle_data = True, resize=224):
num_samples = len(samples)
while True:
random.shuffle(samples)
for offset in range(0, num_samples, batch_size):
batch_samples = samples[offset: offset + batch_size]
X_train = []
y_train = []
for batch_sample in batch_samples:
img_name = batch_sample[0]
label = batch_sample[1]
img = cv2.imread(os.path.join(root_dir, img_name))
#img, label = preprocessing(img, label, new_height=224, new_width=224, num_classes=37)
img = preprocessing(img, new_height=224, new_width=224)
label = my_onehot_encoded(label)
X_train.append(img)
y_train.append(label)
X_train = np.array(X_train)
y_train = np.array(y_train)
yield X_train, y_train
Run Code Online (Sandbox Code Playgroud)
现在,我尝试使用此代码训练神经网络,训练样本大小为 105.000(图像文件包含 37 种可能性中的 8 …
我的数据集中有大约 23300 个每小时数据点,我尝试使用 Facebook Prophet 进行预测。要微调超参数,可以使用交叉验证:
from fbprophet.diagnostics import cross_validation
Run Code Online (Sandbox Code Playgroud)
整个过程如下所示: https: //facebook.github.io/prophet/docs/diagnostics.html
使用cross_validation1 需要指定initial,period和horizon:
df_cv = cross_validation(m, initial='xxx', period='xxx', horizon = 'xxx')
Run Code Online (Sandbox Code Playgroud)
我现在想知道如何在我的情况下配置这三个值?如前所述,我拥有大约 23.300 个每小时数据点的数据。我应该将其中的一小部分作为范围,还是将数据的正确部分作为范围并不那么重要,并且我可以采用任何看起来合适的值?
此外,cutoffs还定义如下:
cutoffs = pd.to_datetime(['2013-02-15', '2013-08-15', '2014-02-15'])
df_cv2 = cross_validation(m, cutoffs=cutoffs, horizon='365 days')
Run Code Online (Sandbox Code Playgroud)
这些是否cutoffs应该像上面一样平均分配,或者我们可以cutoffs按照某人喜欢的方式单独设置它们吗?
我有包含特定弹簧模式的日志文件。这些字符串模式在每个日志事件中频繁出现。例如:
<abc>108</abc>xyz<abc>22222</abc>
Run Code Online (Sandbox Code Playgroud)
我想统计<abc>CloudWatch 中特定时间段内 的出现情况。
我这样做是为了计算每分钟发生的次数:
fields @timestamp
| parse @message "<abc>" as abc
| filter strcontains(@message, "<abc>")
| stats count(abc) by bin(1m)
Run Code Online (Sandbox Code Playgroud)
但它只对<abc>至少包含一次的日志事件计数 1。在上面的例子中,我期望有两个。
我怎样才能实现这个目标?
I have a list of strings which serve as labels for my classification problem (image recognition with a Convolutional Neural Network). These labels consist of 5-8 characters (numbers from 0 to 9 and letters from A to Z). To train my neural network I would like to one hot encode the labels. I wrote a code to encode one label but I am still experiencing difficulties when trying to apply the code to a list.
Here is my code for …
我有这样的日志条目:
第一个条目:
"abc","Id":"XYZ12"},{"lat":55},{"lat":45}{"lat":59}
Run Code Online (Sandbox Code Playgroud)
第二个条目:
"abc","Id":"YZA56"},{"lat":23},{"lat":101}
Run Code Online (Sandbox Code Playgroud)
"lat"我现在想要得到的是每个字符串出现的次数Id。
所以最后我想得到这样的统计数据:
Id occurences
XYZ12 3
YZA56 2
Run Code Online (Sandbox Code Playgroud)
我如何在 Splunk 中执行此操作?我会知道如何获取Id然后以此来计算所有事件Id。但当我想做练习时我不知道该怎么做..
有人可以支持这里吗?
python ×3
aws-cloudwatch-log-insights ×1
hour ×1
list ×1
regex ×1
resize ×1
splunk ×1
tensorflow ×1