【LSTM分类】基于卷积神经网络结合长短时记忆LSTM实现数据分类含Matlab源码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信       无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机 

⛄ 内容介绍

​一种基于长短时记忆网络和卷积神经网络的文本分类方法,首先,利用词向量将输入文本进行向量表示,通过三层CNN提取文本的局部特征,进而整合出全文语义,同时,使用LSTM存储文本序列中历史信息的特征,以获取文本的上下文依赖关系,其次,将输入向量分别与各层CNN的输出相融合,缓解深层神经网络中层与层之间特征传递时出现的特征丢失问题.本发明适用于文本分类,具有运行效率高,运行时间短的优点,解决了传统分类技术在处理复杂抽象和上下文的强相关性文本时的缺陷.

⛄ 部分代码

%% Add path

addpath(genpath('MM_testfunctions/'));

addpath(genpath('Indicator_calculation/'));

 clear all

  clc

%   rand('state',sum(100*clock));

  global fname

  N_function=11;% number of test function

  popsize=800;

  Max_evaluation=80000;

  Max_Gen=fix(Max_evaluation/popsize);

  % Note: It may take a long time to run all 11 test functions and with

  % population size 800 and generation 100. You can change N_function to 1,

  %  popsize to 100, Max_evaluation to 1000, to see how the MO_Ring_PSO_SCD

  %  works.

 for i=1:N_function

    switch i

        case 1

            fname='MMF1';  % function name

            n_obj=2;       % the dimensions of the decision space

            n_var=2;       % the dimensions of the objective space

            xl=[1 -1];     % the low bounds of the decision variables

            xu=[3 1];      % the up bounds of the decision variables

            repoint=[2,2]; % reference point used to calculate the Hypervolume

            load('MMF1truePSPF.mat');

        case 2

            fname='MMF2';

            n_obj=2;

            n_var=2;

            xl=[0 0];

            xu=[1 2];

            repoint=[2,2];

            load('MMF2truePSPF.mat');

        case 3

            fname='MMF3';

            n_obj=2;

            n_var=2;

            xl=[0 0];

            xu=[1 1.5];

            repoint=[2,2];

            load('MMF3truePSPF.mat');

        case 4

            fname='MMF4';

            n_obj=2;

            n_var=2;

            xl=[-1 0];

            xu=[1 2];

            repoint=[2,2];

            load('MMF4truePSPF.mat');

        case 5

            fname='MMF5';

            n_obj=2;

            n_var=2;

            xl=[1 -1];

            xu=[3 3];

            repoint=[2,2];

            load('MMF5truePSPF.mat');

         case 6

            fname='MMF6';

            n_obj=2;

            n_var=2;

            xl=[1 -1];

            xu=[3 2];

            repoint=[2,2];

            load('MMF6truePSPF.mat');

        case 7

            fname='MMF7';

            n_obj=2;

            n_var=2;

            xl=[1 -1];

            xu=[3 1];

            repoint=[2,2];

            load('MMF7truePSPF.mat');

         case 8

            fname='MMF8';

            n_obj=2;

            n_var=2;

            xl=[-pi 0];

            xu=[pi 9];

            repoint=[2,2];

            load('MMF8truePSPF.mat');

         case 9

            fname='SYM_PART_simple';

            n_obj=2;

            n_var=2;

            xl=[-20 -20];

            xu=[20 20];

            repoint=[2,2];

            load('SYM_PART_simple_turePSPF.mat');

         case 10

            fname='SYM_PART_rotated';

            n_obj=2;

            n_var=2;

            xl=[-20 -20];

            xu=[20 20];

            repoint=[2,2];

            load('SYM_PART_rotatedtruePSPF.mat');

        case 11

            fname='Omni_test';

            n_obj=2;

            n_var=3;

            xl=[0 0 0];

            xu=[6 6 6];

            repoint=[5,5];

            load('Omni_testtruePSPF.mat');

    end

   fprintf('Running test function: %s \n', fname);

   %% Search the PSs using MO_Ring_PSO_SCD

    [ps,pf]=MO_Ring_PSO_SCD(fname,xl,xu,n_obj,popsize,Max_Gen);

   %% Indicators

     hyp=Hypervolume_calculation(pf,repoint);

     IGDx=IGD_calculation(ps,PS);

     CR=CR_calculation(ps,PS);

     PSP=CR/IGDx;% Eq. (8) in the paper

⛄ 运行结果

⛄ 参考文献

[1]张潘頔等. "一种基于LSTM卷积神经网络的多标签文本分类方法.", CN110442720A. 2019.

⛳️ 完整代码

❤️部分理论引用网络文献,若有侵权联系博主删除

❤️ 关注我领取海量matlab电子书和数学建模资料

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值