基于 LSTM 的船舶轨迹预测,单步预测

2023-11-06

之前给的数据和代码可能有一些问题,现在从新修改一下,末尾提供数据集和源码链接
单步预测步长:10
单步循环预测长时间的位置:从第1个位置开始,前10个位置(真实位置)预测第11个位置,然后第2个位置到第11个位置(预测值)为一组,预测第12个位置,以此循环预测更长时间的值,其误差会随时间的延长而增加
多步预测:假设单步预测输入4个变量(lon,lat,cog,sog),则输出还是4个变量(lon,lat,cog,sog),若要直接预测两步的话,需要输出8个变量{下一时刻4个 + 下下一时刻4个},即(lon1, lat1, cog1, sog1, lon2, lat2, cog2, sog2)

1、工具包

import numpy as np
import tensorflow as tf
import pandas as pd
import matplotlib.pyplot as plt
from keras.layers.core import Dense, Activation, Dropout
from keras.layers import LSTM
from keras.models import Sequential, load_model
from keras.callbacks import CSVLogger, ReduceLROnPlateau
from keras.optimizers import adam_v2
import transbigdata as tbd
import warnings
warnings.filterwarnings("ignore")
# 设置种子参数,方便复现
np.random.seed(120)
tf.random.set_seed(120)
# 支持中文
plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号

2、读取数据

# 读取数据,updateDateFormat 为定位时间,两分钟一个点,mmsi 为轨迹 id
train = pd.read_csv("./train.csv",index_col=0)
test = pd.read_csv("./test.csv",index_col=0)
train.head()

在这里插入图片描述

3、提取特征和标签数据

每连续的 10 个位置为一组,预测下一个位置

def create_dataset(data, window=10,max_min):
    """
    :param data:  		轨迹数据集合
    :param window: 		多少个数据一组
    :param max_min:		用来归一化
    :return: 	  		数据、标签
    """
    train_seq = []
    train_label = []
    m, n = maxmin
    for traj_id in set(data['mmsi']):
        data_temp = data.loc[data.mmsi == traj_id]
        data_temp = np.array(data_temp.loc[:, ['lon', 'lat', 'sog', 'cog']])
        # 标准化
        data_temp = (data_temp - n) / (m - n)

        for i in range(data_temp.shape[0] - window):
            x = []
            for j in range(i, i + window):
                x.append(list(data_temp[j, :]))
            train_seq.append(x)
            train_label.append(data_temp[i + window, :])

    train_seq = np.array(train_seq, dtype='float64')
    train_label = np.array(train_label, dtype='float64')

    return train_seq, train_label

4、构建模型

def trainModel(train_X, train_Y, test_X, test_Y):
    model = Sequential()
    model.add(LSTM(108, input_shape=(train_X.shape[1], train_X.shape[2]), return_sequences=False))
    # model.add(Dropout(0.3))
    model.add(Dense(train_Y.shape[1]))
    model.add(Activation("relu"))
    adam = adam_v2.Adam(learning_rate=0.01)
    model.compile(loss='mse', optimizer=adam, metrics=['acc'])
    # 保存训练过程中损失函数和精确度的变化
    log = CSVLogger(f"./log.csv", separator=",", append=True)
    # 用来自动降低学习率
    reduce = ReduceLROnPlateau(monitor='val_acc', factor=0.5, patience=1, verbose=1,
                               mode='auto', min_delta=0.001, cooldown=0, min_lr=0.001)
	# 模型训练
    model.fit(train_X, train_Y, epochs=20, batch_size=32, verbose=1, validation_split=0.1,
                  callbacks=[log, reduce])
    # 用测试集评估
    loss, acc = model.evaluate(test_X, test_Y, verbose=1)
    print('Loss : {}, Accuracy: {}'.format(loss, acc * 100))
    # 保存模型
    model.save(f"./model.h5")
    # 打印神经网络结构,统计参数数目
    model.summary()
    return model

5、训练

# 计算归一化参数
nor = np.array(train.loc[:, ['lon', 'lat', 'sog', 'cog']])
m = nor.max(axis=0)
n = nor.min(axis=0)
maxmin = [m, n]
# 步长
windows = 10
# 训练集
train_seq, train_label= createSequence(train, windows, maxmin)
# 测试集
test_seq, test_label = createSequence(test, windows, maxmin)
# 训练模型,我只训练了20次,你可以训练 100 次,精度会更高
model = trainModel(train_seq, train_label,test_seq,test_label)
# 加载训练好的模型
# model = load_model("./model.h5")

6、损失函数和准确率的变化

logs = pd.read_csv("./log.csv")

fig, ax = plt.subplots(2,2,figsize=(8,8))
ax[0][0].plot(logs['epoch'],logs['acc'], label='acc')
ax[0][0].set_title('acc')

ax[0][1].plot(logs['epoch'],logs['loss'], label='loss')
ax[0][1].set_title('loss')

ax[1][0].plot(logs['epoch'],logs['val_acc'], label='val_acc')
ax[1][0].set_title('val_acc')

ax[1][1].plot(logs['epoch'],logs['val_loss'], label='val_loss')
ax[1][1].set_title('val_loss')

plt.show()

请添加图片描述

7、预测

# 多维反归一化
def FNormalizeMult(y_pre, y_true, max_min):
    [m1, n1, s1, c1], [m2, n2, s2, c2] = max_min
    y_pre[:, 0] = y_pre[:, 0] * (m1 - m2) + m2
    y_pre[:, 1] = y_pre[:, 1] * (n1 - n2) + n2
    y_pre[:, 2] = y_pre[:, 2] * (s1 - s2) + s2
    y_pre[:, 3] = y_pre[:, 3] * (c1 - c2) + c2
    y_true[:, 0] = y_true[:, 0] * (m1 - m2) + m2
    y_true[:, 1] = y_true[:, 1] * (n1 - n2) + n2
    y_true[:, 2] = y_true[:, 2] * (s1 - s2) + s2
    y_true[:, 3] = y_true[:, 3] * (c1 - c2) + c2

    # 计算真实值和预测值偏差的距离
    y_pre = np.insert(y_pre, y_pre.shape[1],
                      get_distance_hav(y_true[:, 1], y_true[:, 0], y_pre[:, 1], y_pre[:, 0]), axis=1)

    return y_pre, y_true
    
def hav(theta):
    s = np.sin(theta / 2)
    return s * s
#  计算坐标在 WGS84 下的距离
def get_distance_hav(lat0, lng0, lat1, lng1):
    EARTH_RADIUS = 6371
    lat0 = np.radians(lat0)
    lat1 = np.radians(lat1)
    lng0 = np.radians(lng0)
    lng1 = np.radians(lng1)

    dlng = np.fabs(lng0 - lng1)
    dlat = np.fabs(lat0 - lat1)
    h = hav(dlat) + np.cos(lat0) * np.cos(lat1) * hav(dlng)
    distance = 2 * EARTH_RADIUS * np.arcsin(np.sqrt(h))
    return distance

单步预测

test_points_ids = list(set(test['mmsi']))

for ids in test_points_ids[:1]:
    y_pre = []
    test_seq, test_label = createSequence(test.loc[test.mmsi == ids], windows, maxmin)

    y_true = test_label
    for i in range(len(test_seq)):
        y_hat = model.predict(test_seq[i].reshape(1, windows, 4))
        y_pre.append(y_hat[0])
    y_pre = np.array(y_pre, dtype='float64')
	# 反归一化
    f_y_pre, f_y_true = FNormalizeMult(y_pre, y_true, maxmin)

    print(f"最大值: {max(f_y_pre[:, 4])}\n最小值: {min(f_y_pre[:, 4])}\n均值: {np.mean(f_y_pre[:, 4])}\n"
          f"方差: {np.var(f_y_pre[:, 4])}\n标准差: {np.std(f_y_pre[:, 4])}\n中位数: {np.median(f_y_pre[:, 4])}")

    plt.figure(figsize=(16, 5))
    plt.subplot(121)
    plt.plot(f_y_true[:, 0], f_y_true[:, 1], "ro", markersize=6,label='真实值')
    plt.plot(f_y_pre[:, 0], f_y_pre[:, 1], "bo",markersize=4, label='预测值')
    bounds = [min(f_y_true[:, 0])-0.02,min(f_y_true[:, 1])-0.01,max(f_y_true[:, 0])+0.02,max(f_y_true[:, 1])+0.01]
    tbd.plot_map(plt,bounds,zoom = 16,style = 3)
    plt.legend(fontsize=14)
    plt.grid()
    plt.xlabel("经度",fontsize=14)
    plt.ylabel("纬度",fontsize=14)
    plt.title("MMSI:",fontsize=17)

    meanss = np.mean(f_y_pre[:, 4])
    plt.subplot(122)
    plt.bar(range(f_y_pre.shape[0]),f_y_pre[:, 4],label='误差')
    plt.plot([0,f_y_pre.shape[0]],[meanss,meanss],'--r',label="均值")
    plt.title("预测值和真实值的误差",fontsize=17)
    plt.xlabel("船舶轨迹点",fontsize=14)
    plt.ylabel("预测误差(KM)",fontsize=14)
    plt.text(f_y_pre.shape[0]*1.01,meanss*0.96,round(meanss,4),fontsize=14,color='r')
    plt.grid()
    plt.legend(fontsize=14)

    plt.figure(figsize=(16, 6))
    plt.subplot(121)
    plt.plot(f_y_pre[:, 2], "b-", label='预测值')
    plt.plot(f_y_true[:, 2], "r-", label='真实值')
    plt.legend(fontsize=14)
    plt.title("航速预测",fontsize=17)
    plt.xlabel("船舶轨迹点",fontsize=14)
    plt.ylabel("航速/节",fontsize=14)
    plt.grid()

    plt.subplot(122)
    plt.plot(f_y_pre[:, 3], "b-", label='预测值')
    plt.plot(f_y_true[:, 3], "r-", label='真实值')
    plt.legend(fontsize=14)
    plt.title("航向预测",fontsize=17)
    plt.xlabel("船舶轨迹点",fontsize=14)
    plt.ylabel("航向/度",fontsize=14)
    plt.grid()

请添加图片描述
请添加图片描述

多步预测,船舶位置在最后一个黄色点位置

for ids in test_points_ids[:1]:
    test_seq, test_label = createSequence(test.loc[test.mmsi == ids], windows,maxmin)

    y_pre = []
    for i in range(len(test_seq)):
        y_hat = model.predict(test_seq[i].reshape(1, windows, 4))
        y_pre.append(y_hat[0])
    y_pre = np.array(y_pre, dtype='float64')
    # 得到真实值
    _,true_lables = FNormalizeMult(y_pre,np.copy(test_label),maxmin)
    
	# 从第四个开始预测
    for start_id in range(3,4):
        # 单值预测
        y_pre=[]
        y_true = []
        pre_seq = test_seq[start_id]
        # 最多预测 15 分钟
        maxStep = min(15,test_seq.shape[0] - start_id)
        # 循环预测
        for i in range(maxStep):
            y_hat = model.predict(pre_seq.reshape(1, windows, 4))
            y_pre.append(y_hat[0])
            y_true.append(test_label[start_id+i])
            # 下一个数组
            pre_seq = np.insert(pre_seq, pre_seq.shape[0], y_pre[i], axis=0)[1:]

        y_pre = np.array(y_pre, dtype='float64')
        y_true = np.array(y_true, dtype='float64')
        f_y_pre,f_y_true = FNormalizeMult(y_pre,y_true,maxmin)

        plt.figure(figsize=(14,6))
        plt.subplot(121)
        plt.plot(f_y_pre[:, 0], f_y_pre[:, 1], "bo", label='预测值')
        plt.plot(f_y_true[:, 0], f_y_true[:, 1], "ro", label='真实值')
        plt.plot(true_lables[:start_id, 0], true_lables[:start_id, 1], "o",color='#eef200', label='历史位置')
        bounds = [min(f_y_true[:, 0])-0.01,min(f_y_true[:, 1])-0.01,max(f_y_true[:, 0])+0.01,max(f_y_true[:, 1])+0.01]
        tbd.plot_map(plt,bounds,zoom = 16,style = 3)
        plt.legend(fontsize=15)
        plt.title(f'预测步数量={maxStep},开始位置={start_id}',fontsize=17)
        plt.title(f'真实轨迹与预测轨迹',fontsize=17)
        plt.xlabel("经度",fontsize=15)
        plt.ylabel("纬度",fontsize=15)
        plt.grid()

        plt.subplot(122)
        plt.plot(np.arange(2,2*(maxStep)+1,2),f_y_pre[:,4])
        plt.xticks(np.arange(2,2*(maxStep)+1,2))
        plt.title(f'随着时间迭代的距离误差',fontsize=17)
        plt.xlabel("时间/分钟",fontsize=15)
        plt.ylabel("距离误差/千米",fontsize=15)
        plt.grid()
        plt.show()

请添加图片描述

在整条轨迹上预测30分钟的误差

每个点都预测未来30分钟内的位置,然后把预测的某个时间(比如2分钟)的所有误差加到一起求均值

# 保存所有的预测误差
error_list = []
for ids in test_points_ids[:1]:
    test_seq, test_label = createSequence(test.loc[test.mmsi == ids], windows, maxmin)
    # 要预测的时间
    pre_time = 30
    for start_id in range(test_seq.shape[0]-int(pre_time/2)):
        # 单值预测
        y_pre=[]
        y_true = []
        pre_seq = test_seq[start_id]
        for i in range(int(pre_time/2)):
            y_hat = model.predict(pre_seq.reshape(1, windows, 4))
            y_pre.append(y_hat[0])
            y_true.append(test_label[start_id+i])
            # 下一个数组
            pre_seq = np.insert(pre_seq, pre_seq.shape[0], y_pre[i], axis=0)[1:]

        y_pre = np.array(y_pre, dtype='float64')
        y_true = np.array(y_true, dtype='float64')
        f_y_pre,f_y_true = FNormalizeMult(y_pre,y_true,maxmin)
        error_list.append(list(f_y_pre[:,4]))
b = np.zeros([len(error_list),len(max(error_list,key = lambda x: len(x)))])
for i,j in enumerate(error_list):
    b[i][0:len(j)] = j

sums = b.sum(axis=0)
maxx = b.max(axis=0)
minx = []
means = []
# 计算某个时间的预测误差的最值和均值
for col in range(b.shape[1]):
    fzeros = b.shape[0] - list(b[:,col]).count(0.0)
    minx.append(min(list(b[:fzeros,col])))
    means.append(sums[col] / fzeros)

plt.figure(figsize=(12,6))
plt.plot(np.arange(2,2*(b.shape[1])+1,2),means,'-r',label='平均误差')
plt.plot(np.arange(2,2*(b.shape[1])+1,2),minx,'-g',label='最小误差')
plt.plot(np.arange(2,2*(b.shape[1])+1,2),maxx,'-y',label='最大误差')
plt.xticks(np.arange(2,2*(b.shape[1])+1,2))
plt.yticks(np.arange(0,max(maxx),0.02))
plt.xlabel("时间/分钟",fontsize=14)
plt.ylabel("距离误差/千米",fontsize=14)
plt.legend(fontsize=14)
plt.grid()
plt.title("整条轨迹上随时间变化的预测距离误差",fontsize=17)

在这里插入图片描述

数据集及源码:

CSDN(免费): https://download.csdn.net/download/weixin_43261465/87526631
百度网盘:https://pan.baidu.com/s/1htJcYbmCgAh181SepREsiA 提取码: enpd

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

基于 LSTM 的船舶轨迹预测,单步预测 的相关文章

  • 在 Python 中处理单值元组的最佳实践是什么?

    我正在使用第三方库函数 它从文件中读取一组关键字 并且应该返回一个值的元组 只要有至少两个关键字 它就能正确执行此操作 但是 在只有一个关键字的情况下 它返回一个原始字符串 而不是大小为 1 的元组 这是特别有害的 因为当我尝试做类似的事情
  • 出现导入错误:无法从“随机”导入名称“随机”[重复]

    这个问题在这里已经有答案了 我在我的计算机上多次运行我的代码 但没有出现此错误 但突然间这个来了 File e Python 3 8 0 lib site packages comtypes client code cache py lin
  • 如何在 Linux 中显示进程状态(阻塞、非阻塞)

    有没有办法查询 Linux 进程表中进程的状态 以便能够演示执行查询时进程是正在运行还是被阻止 我的目标是从进程或程序的 外部 执行此操作 因为我希望从操作系统进程的角度来理解这一点 但欢迎任何想法 这是Python代码阻塞的过程 impo
  • Python 可以使用单独的媒体播放器打开 mp3 文件吗? [关闭]

    Closed 这个问题需要多问focused help closed questions 目前不接受答案 是否可以开一个mp3Python 中的文件 可以使用Popen 我并不是要在程序中运行它 我的意思是作为媒体播放器中的一个单独窗口或其
  • Python MySQL 模块

    我正在开发一个需要与 MySQL 数据库交互的 Web 应用程序 但我似乎找不到任何真正适合 Python 的模块 我特别寻找快速模块 能够处理数十万个连接 和查询 所有这些都在短时间内完成 而不会对速度产生重大影响 我想我的答案将是游戏领
  • 将列表传递给 PyCrypto 中的 AES 密钥生成器

    我尝试使用 Pycrypto 生成 AES 密钥 但收到以下错误 类型错误 列表 不支持缓冲区接口 对于以下声明 aescipher AES new mykey AES MODE ECB mykey 属于类型list并包含 18854347
  • 字母表中的加密和解密 - Python GCSE

    我目前正在尝试为学校编写一个程序 以便加密和解密输入的消息 我需要加密或解密的消息仅在字母表中 没有其他符号或密钥 例如 使用消息车加密输入的偏移量为 5 我希望它输出 afs 有人可以帮忙吗 这是我目前的代码 def find offse
  • 按字段名称对命名元组列表进行排序的 Pythonic 方法

    我想对命名元组列表进行排序 而不必记住字段名的索引 我的解决方案看起来相当尴尬 希望有人能有一个更优雅的解决方案 from operator import itemgetter from collections import namedtu
  • Python argparse store_true 并将可选选项存储在一个参数中[重复]

    这个问题在这里已经有答案了 我需要识别是否单独给出参数或带有可选字符串或两者都没有 parser add argument options parser parse args so prog py arg 应该存储 进入选项 arg pro
  • 将 csv 文件按多列拆分为 panda 数据框

    我有一个包含多列的 tsv 文件 有 10 多列 但对我来说重要的列是名称为 user name shift id url id 的列 我想创建一个数据框 首先根据用户名分隔整个 csv 文件 即只有具有相同用户名的行才会分组在一起 从该块
  • 在 Docker 容器内运行时,如何自动在 API 路由文件中进行 FASTAPI 拾取更改?

    我通过 docker 运行 FastApi 在 docker compose 中创建一个名为 ingestion data 的服务 我的 Dockerfile FROM tiangolo uvicorn gunicorn fastapi p
  • 尝试修复我的功能

    我正在开发一个函数 我必须返回一个元组 其中第一个参数是最大数字的 str 第二个参数是 int 列表 这是示例以及我为该函数编写的内容 投票 G G N G C G 1 3 0 1 您必须将最大值的位置映射到正确的一方 parties N
  • 监控单个文件

    我需要监控 使用watchdog http pythonhosted org watchdog index html 单个文件 而不是整个目录 避免监视整个目录的最佳方法是什么 我想this http pythonhosted org wa
  • import numpy 和 import numpy as np 之间的区别

    我明白 如果可能的话 应该使用 import numpy as np 这有助于避免由于命名空间引起的任何冲突 但我注意到虽然下面的命令有效 import numpy f2py as myf2py 以下不 import numpy as np
  • 收到的标签值 1 超出了 [0, 1) 的有效范围 - Python、Keras

    我正在使用具有张量流背景的 keras 开发一个简单的 cnn 分类器 def cnnKeras training data training labels test data test labels n dim print Initiat
  • Python 类方法的示例用例是什么?

    我读了Python 中的类方法有什么用 https stackoverflow com questions 38238 what are class methods in python for但那篇文章中的例子很复杂 我正在寻找 Pytho
  • python 函数返回 javascript date.getTime()

    我正在尝试创建一个简单的 python 函数 它将返回与 javascript 相同的值new Date getTime 方法 如所写here http www w3schools com js js dates asp javascrip
  • 用于桌面数据库应用程序的 Python 框架

    是否有一个框架可以为Python开发桌面数据库应用程序 一些带有CRUD屏幕的屏幕 我正在寻找类似于 Windows 窗体的东西 能够将 TextField Combos 和其他 UI 隐喻与datasets连接到关系数据库例如 MySQL
  • 连接运算符 + 或 ,

    var1 abc var2 xyz print literal var1 var2 literalabcxyz print literal var1 var2 literal abc xyz 除了带有 的自动空格之外 两者有什么区别 哪个通
  • PyQt QFileDialog exec_ 很慢

    我正在使用自定义QFileDialog因为我想选择多个目录 但是exec 功能非常慢 我不明白为什么 我正在使用最新版本的 PyQt 代码片段 from PyQt4 import QtGui QtCore QtNetwork uic cla

随机推荐

  • VMware Workstation克隆虚拟机(CentOS系统)

    问题 VMware Workstation克隆虚拟机 CentOS系统 下面具体说明下 如何在VMware Workstation中克隆一台已有的虚拟机 方法 如下图所示 要克隆名叫 CentOS7 base的一台虚拟 右键该虚拟机选择 管
  • userManager.do不可用问题

    dao层和业务层都可以成功添加 但在页面上调用Servlet显示不可用 原因 userAdd jsp被放到了web的子目录usermanager下面了 所以定位不到servlet资源了 修改 userManager do 成功解决问题
  • 怎么查EI论文的检索号

    论文题目 Study on joint probability density algorithm in multi sensor data fusion 那位热心人帮忙查一下检索号是多少啊 去http www engineeringvil
  • OpenCV调用cv2.imshow显示错误 “The function is not implemented. Rebuild the library with Windows”的解决办法

    在Windows环境下 已经安装了opencv python 读取图片 处理都没有问题 唯独显示就会出错 说 The function is not implemented Rebuild the library with Windows
  • Android 蓝牙开发(六)hfp连接

    转载请注明出处 http blog csdn net vnanyesheshou article details 71106622 本文已授权微信公众号 fanfan程序媛 独家发布 扫一扫文章底部的二维码或在微信搜索 fanfan程序媛
  • nginx+php 出现404错误解决方法

    http www 51ou com browse linuxwt 32263 html 错误日志 装好 nginx 1 0 5 与 php 5 3 6 php fpm 迫不及待的测试 info php 但是只返回了空白页 什么也没有输出 以
  • 关于解决Linux(ubuntu) 中不允许root用户ssh远程登录的问题

    当我们在ubuntu中登录ssh的时候 会出现如下问题 是因为系统默认禁止root用户登录ssh 此时我们可以这样解决 1 首先 按Ctrl C退出密码输入界面 2 然后输入 su 一定是su 不是su 3 编辑sshd config文件
  • VS快捷键大全(超详细)

    本文主要介绍VS编译器下的快捷键 文章目录 1 项目相关的快捷键 2 编辑相关的键盘快捷键 3 导航相关的键盘快捷键 4 调试相关的键盘快捷键 5 搜索相关的键盘快捷键 1 项目相关的快捷键 Ctrl Shift B 生成项目 Ctrl A
  • 2020.11.14 数组的相对排序

    2020 11 14 数组的相对排序 题目描述 给你两个数组 arr1 和 arr2 arr2 中的元素各不相同 arr2 中的每个元素都出现在 arr1 中 对 arr1 中的元素进行排序 使 arr1 中项的相对顺序和 arr2 中的相
  • CORE-ESP32C3

    目录 参考博文 项目官方地址 显示效果 硬件准备 软件版本 日志及soc下载工具 软件使用 接线示意图 硬件接线 一 Elink驱动管脚适配 二 天气信息获取 API使用方式 接口格式 注意需不需要tls http apicn luatos
  • Error[Pe147]: declaration is incompatible with "__nounwind __interwork __softfp unsigned long __get_

    原文地址 http www emcu it ARM Compiler IAR IAR tips and tricks html IAR tips and tricks Home Page STM32 home page CMSIS buil
  • vue项目兼容IE11

    1 npm安装babel polyfill npm install babel polyfill save dev 2 在入口文件main js中引入 import babel polyfill 3 如果也是用了官方脚手架vue cli 还
  • Tomcat项目500报错处理方法之一

    今天做的项目出现了Tomcat500错误 根据错误提示是 java lang ClassNotFoundException 搜索了很多解决方法 最终找到一个解决方案 https blog csdn net u011008029 articl
  • 类#是公共的,应在名为#.java的文件中声明

    1 如果类A被声明为公共的 public 那么必须将类A保存在名为A java的文件中 2 反之 在一个文件中最多包含一个顶级的公共类 并且该公共类的名字与文件名相同 比如文件A java中 允许定义一个或多个类 但最多允许一个顶级的公共类
  • 又一波Microsemi招聘信息

    Position Manager ASIC Design Business Unit ESC PerformanceStorage Location Shanghai China Youwill build and lead an IC d
  • Deeplabcut----(3)新建自己的训练(多只动物)

    多动物的标注比单动物复杂了N倍 动物回来会穿梭 以至于一时不知道是哪只 需要对比着视频观看找对应的 1 打开deeplabcut 新建训练 2 编辑配置文件设置动物数量 关节 骨架等 单击Edit config file开始编辑 可以按照自
  • RT-DETR原理与简介(干翻YOLO的最新目标检测项目)

    概述与简介 RT DETR是一种实时目标检测模型 它结合了两种经典的目标检测方法 Transformer和DETR Detection Transformer Transformer是一种用于序列建模的神经网络架构 最初是用于自然语言处理
  • Hugging Face——MLM预训练掩码语言模型方法

    对于许多涉及 Transformer 模型的 NLP 程序 我们可以简单地从 Hugging Face Hub 中获取一个预训练的模型 然后直接在你的数据上对其进行微调 以完成手头的任务 只要用于预训练的语料库与用于微调的语料库没有太大区别
  • PHP CGI、FastCGI、PHP-FPM、PHP-CGI 区别

    PHP CGI FastCGI PHP FPM PHP CGI是不同的PHP执行方式和处理程序 它们有以下区别 PHP CGI Common Gateway Interface PHP CGI是一种通过CGI协议与Web服务器通信的PHP执
  • 基于 LSTM 的船舶轨迹预测,单步预测

    之前给的数据和代码可能有一些问题 现在从新修改一下 末尾提供数据集和源码链接 单步预测步长 10 单步循环预测长时间的位置 从第1个位置开始 前10个位置 真实位置 预测第11个位置 然后第2个位置到第11个位置 预测值 为一组 预测第12