WO2020211237A1 - 基于神经网络的以词生成节奏的方法、装置及存储介质 - Google Patents
基于神经网络的以词生成节奏的方法、装置及存储介质 Download PDFInfo
- Publication number
- WO2020211237A1 WO2020211237A1 PCT/CN2019/102189 CN2019102189W WO2020211237A1 WO 2020211237 A1 WO2020211237 A1 WO 2020211237A1 CN 2019102189 W CN2019102189 W CN 2019102189W WO 2020211237 A1 WO2020211237 A1 WO 2020211237A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- lyrics
- time
- rhythm
- layer
- neural network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/60—Information retrieval; Database structures therefor; File system structures therefor of audio data
- G06F16/68—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/683—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
- G06F16/685—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using automatically derived transcript of audio data, e.g. lyrics
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02B—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
- Y02B20/00—Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
- Y02B20/40—Control techniques providing energy savings, e.g. smart controller or presence detection
Definitions
- This application relates to the field of artificial intelligence technology, and in particular to a method, device and computer-readable storage medium for generating rhythm from words based on neural network.
- Music rhythm is an important part of the automatic music generation algorithm. Music rhythm can regulate the distribution of lyrics, and at the same time can constrain pitch and melody. It is a bridge connecting lyrics and music.
- Traditional speech recognition and music model construction use state modeling. A phoneme or a word is artificially divided into multiple states with no physical meaning, and then discrete or continuous Gaussian models are used to describe the output distribution of each state. This modeling method needs to segment the boundary of the modeling unit in the middle of the continuous sequence in advance, and the edge of the input and output distribution is aligned, and the calculation speed is slow.
- This application provides a method, device and computer-readable storage medium for generating rhythms from words based on neural networks, and its main purpose is to provide a technical solution for applying deep learning networks to music rhythm generation.
- a method for generating rhythm with words based on neural network includes:
- the preset lyrics encoding rules include: specifying that a single character in the lyrics is 1, a single punctuation mark is 0, and 0 is used between characters filling;
- Pre-constructing a neural network model where the pre-constructed neural network model includes a three-layer spatiotemporal convolutional network and a layer of bidirectional gated cyclic unit;
- the lyrics are classified in connection time sequence to obtain the target rhythm.
- the present application also provides a neural network-based device for generating rhythms with words.
- the device includes a memory and a processor.
- the memory stores a word generating device that can run on the processor.
- a rhythm program which, when executed by the processor, realizes a method for generating rhythm from words based on a neural network, the method comprising:
- the preset lyrics encoding rules include: specifying that a single character in the lyrics is 1, a single punctuation mark is 0, and 0 is used between characters filling;
- Pre-constructing a neural network model where the pre-constructed neural network model includes a three-layer spatiotemporal convolutional network and a layer of bidirectional gated cyclic unit;
- the lyrics are classified in connection time sequence to obtain the target rhythm.
- the present application also provides a computer-readable storage medium that stores a word-generated rhythm program on the computer-readable storage medium, and the word-generated rhythm program can be processed by one or more
- the device executes to realize the steps of the method for generating rhythm with words based on neural network as described above.
- the neural network-based method, device and computer-readable storage medium for generating rhythm from words proposed in this application convert the lyrics of a given music into a set of vectors according to preset lyrics encoding rules; input to a pre-built neural network model Determine the vector set of the lyrics of the music to obtain the time series distribution of the lyrics; use the time series distribution to classify the connection sequence of the lyrics to obtain the target rhythm. Therefore, this application applies the deep learning network to the generation of music rhythm and can obtain reliable results so that the generated music is more in line with the original music specifications.
- FIG. 1 is a schematic flow chart of a method for generating rhythm with words based on a neural network according to an embodiment of the application;
- FIG. 2 is a schematic diagram of the bidirectional gated cyclic unit described in the method for generating rhythm with words based on neural network according to an embodiment of the application;
- FIG. 3 is a schematic diagram of a data flow in a method for generating rhythm with words based on a neural network according to an embodiment of the application;
- FIG. 4 is a schematic diagram of the internal structure of a device for generating rhythm from words based on a neural network according to an embodiment of the application;
- Fig. 5 is a schematic diagram of modules of a word-generating rhythm program in a word-generating rhythm device based on a neural network provided by an embodiment of the application.
- This application provides a method for generating rhythm with words based on neural network.
- FIG. 1 it is a schematic flowchart of a neural network-based method for generating rhythm with words according to an embodiment of this application.
- the method can be executed by a device, and the device can be implemented by software and/or hardware.
- the method for generating rhythm with words based on neural network includes:
- the preset lyrics encoding rules include: specifying that a single character in the lyrics is 1, a single punctuation mark is 0, and the characters are filled with 0.
- time is the BCD code (Binary-Coded Decimal, also known as binary-coded decimal or binary-decimal code) of the time when the lyrics appear in the music
- 1 by extension refers to the height and width of the image.
- one character is equivalent to one pixel, so the width and height are set to 1
- channel is the above-mentioned lyrics encoding, as described above, the channel value of a single character is 1, and the channel value of a single punctuation is 0, etc.
- the pre-built neural network model described in this application includes three layers of spatiotemporal convolutional neural networks (STCNNs) and one layer of bidirectional gated recurrent units (Bi-GRU, Bidirectional Gated Recurrent Unit).
- STCNNs spatiotemporal convolutional neural networks
- Bi-GRU bidirectional gated recurrent units
- Convolutional Neural Networks are feed-forward neural networks that can perform convolutional stacking operations on the image space, which helps to improve the performance of computer vision tasks.
- the spatiotemporal convolutional network STCNNs can process audio and video data by performing convolution operations in time and space dimensions.
- y represents the output of a certain layer
- ⁇ represents the activation function
- i, j, and k represent the coordinates of the corresponding position on the sample
- b represents the offset value of the corresponding convolution kernel.
- the three-layer STCNNs convolution kernel shape is The four dimensions are time, height, width and feature number.
- the feature vector z can be extracted after inputting the vector set X of the lyrics of the given music into the three-layer spatiotemporal convolutional network.
- this application uses Bi-GRU to further aggregate the feature vectors z extracted by STCNNs to obtain the time step.
- a layer of bidirectional gated recurrent unit (Bi-GRU) is connected after STCNNs.
- GRU is a variant of Recurrent Neural Network (RNN).
- the repeating unit model of GRU is as follows. It has two gates, an update gate u t and a reset gate r t .
- the update gate is used to control the extent to which the state information at the previous moment is brought into the current state. The larger the value of the update gate, the more state information at the previous moment is brought in.
- the reset gate is used to control the degree of ignoring the state information at the previous moment. The smaller the reset gate value, the more ignored.
- Bi-GRU The main feature of Bi-GRU is to increase the ability to learn in the future and overcome the shortcomings of only being able to process historical information.
- Bi-GRU splits an ordinary GRU into two directions, one is forward in sequence, and the other is reverse in sequence. However, two GRUs are connected to the same input layer and output layer. The structure is shown in Figure 2. In a preferred embodiment of the present application, the number of neurons in the Bi-GRU is 256.
- the Bi-GRU described in this application uses the following formula to obtain the time step:
- u t and r t are the update gate and the reset gate respectively
- [] means the two vectors are connected
- * means matrix elements are multiplied
- ⁇ is the sigmoid function
- z ⁇ z 1 ,...
- z t ⁇ is Bi -GRU output characteristic of an input STCNNs i.e., W r and W u are reset and the update right door of the door weight, Represents the candidate state at time t
- Means The weight of h t is the output state at time t.
- this application performs a linear transformation on each time step h t to obtain a time series distribution.
- this application makes p( ut
- z) softmax(mlp(h t ; W mlp )), where softmax is a normalized exponential function, and mlp is A feedforward neural network with weights W mlp , and then define the time series distribution:
- z is the input of GRU, that is, the output of STCNNs. That is, when the input is z, the output state at time t is reversely transmitted to obtain the classification of each state at time t.
- the time series distribution p of the number of time steps T that is, the vector length of z
- the CTC is a top layer specially designed for RNN, which is used for sequence learning, and it can eliminate the step of aligning the input with the target output.
- the main process of performing CTC on the lyrics is as follows:
- V * is the set of all paths
- z) represents the sum of the probabilities of the corresponding paths of the target lyrics set V
- z is the output of the three-layer spatiotemporal convolutional network Characteristic vector
- T is the number of all time steps
- z) is the time series distribution of all time steps T
- the expression needs Satisfies the condition that u is among all time steps T
- the data flow of this application is as follows: For a piece of music, the preferred embodiment of this application converts the lyrics in the music into a vector, and transmits it to the constructed neural network to obtain the time Sequence, wherein the neural network described in this application includes a three-layer spatio-temporal convolutional network and a layer of bidirectional gated loop unit; input the obtained time sequence into the connection sequence classification, and input the target lyrics at the same time, and finally obtain the corresponding target lyrics The sequence is the rhythm of the target lyrics corresponding to this piece of music.
- This application also provides a device for generating rhythm with words based on neural network.
- FIG. 4 it is a schematic diagram of the internal structure of an apparatus for generating rhythm from words based on a neural network provided by an embodiment of the present application.
- the apparatus 1 for generating rhythm from words based on neural network may be a PC (Personal Computer, personal computer), or a terminal device such as a smart phone, a tablet computer, and a portable computer.
- the neural network-based word-generating rhythm device 1 at least includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
- the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc.
- the memory 11 may be an internal storage unit of the apparatus 1 for generating a rhythm with words based on a neural network, for example, a hard disk of the apparatus 1 for generating a rhythm with words based on a neural network.
- the memory 11 may also be an external storage device of the word-generating rhythm device 1 based on a neural network, such as a plug-in hard disk equipped on the neural network-based word-generating rhythm device 1, and a smart memory card (Smart Memory Card).
- the memory 11 may also include both the internal storage unit of the word-generating rhythm device 1 and an external storage device.
- the memory 11 can be used not only to store the application software and various data installed in the neural network-based rhythm generation device 1 with words, such as the code of the word generation rhythm program 01, etc., but also to temporarily store the output or will be output The data.
- the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor or other data processing chip in some embodiments, and is used to run the program code or processing stored in the memory 11 Data, such as the execution of the word-generation rhythm program 01.
- CPU central processing unit
- controller microcontroller
- microprocessor or other data processing chip in some embodiments, and is used to run the program code or processing stored in the memory 11 Data, such as the execution of the word-generation rhythm program 01.
- the communication bus 13 is used to realize the connection and communication between these components.
- the network interface 14 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface), and is usually used to establish a communication connection between the device 1 and other electronic devices.
- the device 1 may also include a user interface.
- the user interface may include a display (Display) and an input unit such as a keyboard (Keyboard).
- the optional user interface may also include a standard wired interface and a wireless interface.
- the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, etc.
- the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the neural network-based word-generation rhythm device 1 and to display a visualized user interface.
- Figure 4 only shows the neural network-based word-generation rhythm device 1 with components 11-14 and the word-generation rhythm program 01. Those skilled in the art can understand that the structure shown in Figure 4 does not constitute a
- the definition of the word-generating rhythm device 1 of the neural network may include fewer or more components than shown, or a combination of certain components, or a different component arrangement.
- the memory 11 stores the word-generation rhythm program 01; when the processor 12 executes the word-generation rhythm program 01 stored in the memory 11, the following steps are implemented:
- Step 1 Convert the lyrics of the given music into a vector set according to the preset lyrics encoding rules.
- the preset lyrics encoding rules include: specifying that a single character in the lyrics is 1, a single punctuation mark is 0, and the characters are filled with 0.
- time is the BCD code (Binary-Coded Decimal, also known as binary-coded decimal or binary-decimal code) of the time when the lyrics appear in the music
- 1 by extension refers to the height and width of the image.
- one character is equivalent to one pixel, so the width and height are set to 1
- channel is the above-mentioned lyrics encoding, as described above, the channel value of a single character is 1, and the channel value of a single punctuation is 0, etc.
- Step 2 Input the vector set of lyrics of the given music into the pre-built neural network model to obtain the time series distribution of the lyrics.
- the pre-built neural network model described in this application includes three layers of spatiotemporal convolutional neural networks (STCNNs) and one layer of bidirectional gated recurrent units (Bi-GRU, Bidirectional Gated Recurrent Unit).
- STCNNs spatiotemporal convolutional neural networks
- Bi-GRU bidirectional gated recurrent units
- Convolutional Neural Networks are feed-forward neural networks that can perform convolutional stacking operations on the image space, which helps to improve the performance of computer vision tasks.
- the spatiotemporal convolutional network STCNNs can process audio and video data by performing convolution operations in time and space dimensions.
- y represents the output of a certain layer
- ⁇ represents the activation function
- i, j, and k represent the coordinates of the corresponding position on the sample
- b represents the offset value of the corresponding convolution kernel.
- the three-layer STCNNs convolution kernel shape is The four dimensions are time, height, width and feature number.
- the feature vector z can be extracted after inputting the vector set X of the lyrics of the given music into the three-layer spatiotemporal convolutional network.
- this application uses Bi-GRU to further aggregate the feature vectors z extracted by STCNNs to obtain the time step.
- a layer of bidirectional gated recurrent unit (Bi-GRU) is connected after STCNNs.
- GRU is a variant of Recurrent Neural Network (RNN).
- the repeating unit model of GRU is as follows. It has two gates, an update gate u t and a reset gate r t .
- the update gate is used to control the extent to which the state information at the previous moment is brought into the current state. The larger the value of the update gate, the more state information at the previous moment is brought in.
- the reset gate is used to control the degree of ignoring the state information at the previous moment. The smaller the reset gate value, the more ignored.
- Bi-GRU The main feature of Bi-GRU is to increase the ability to learn in the future and overcome the shortcomings of only being able to process historical information.
- Bi-GRU splits an ordinary GRU into two directions, one is forward in sequence, and the other is reverse in sequence. However, two GRUs are connected to the same input layer and output layer. The structure is shown in Figure 2. In a preferred embodiment of the present application, the number of neurons in the Bi-GRU is 256.
- the Bi-GRU described in this application uses the following formula to obtain the time step:
- u t and r t are the update gate and the reset gate respectively
- [] means the two vectors are connected
- * means matrix elements are multiplied
- ⁇ is the sigmoid function
- z ⁇ z 1 ,...
- z t ⁇ is Bi -GRU output characteristic of an input STCNNs i.e., W r and W u are reset and the update right door of the door weight, Represents the candidate state at time t
- Means The weight of h t is the output state at time t.
- this application performs a linear transformation on each time step h t to obtain a time series distribution.
- this application makes p( ut
- z) softmax(mlp(h t ; W mlp )), where softmax is a normalized exponential function, and mlp is A feedforward neural network with weights W mlp , and then define the time series distribution:
- z is the input of GRU, that is, the output of STCNNs. That is, when the input is z, the output state at time t is reversely transmitted to obtain the classification of each state at time t.
- the time series distribution p of the number of time steps T that is, the vector length of z
- Step 3 Use the time sequence distribution to perform connection timing classification (Connectionist temporal classification, CTC) on the lyrics to obtain a target rhythm.
- connection timing classification Connectionist temporal classification, CTC
- the CTC is a top layer specially designed for RNN, which is used for sequence learning, and it can eliminate the step of aligning the input with the target output.
- the main process of performing CTC on the lyrics is as follows:
- V * is the set of all paths
- z) represents the sum of the probabilities of the corresponding paths of the target lyrics set V
- z is the output of the three-layer spatiotemporal convolutional network Characteristic vector
- T is the number of all time steps
- z) is the time series distribution of all time steps T
- the expression needs Satisfies the condition that u is among all time steps T
- the word-generating rhythm program can also be divided into one or more modules, and the one or more modules are stored in the memory 11 and run by one or more processors ( This embodiment is executed by the processor 12) to complete the application.
- the module referred to in this application refers to a series of computer program instruction segments that can complete specific functions, and is used to describe the word-generation rhythm program in the neural network-based word-by-word program. Generate the execution process in the rhythm device.
- FIG. 5 a schematic diagram of program modules of a word-generating rhythm program in an embodiment of a neural network-based device for generating rhythm from words in this application.
- the word-generating rhythm program 01 can be divided into The lyrics conversion module 10, the model calculation module 20, and the rhythm generation module 30 are illustratively:
- the lyrics conversion module 10 is used for: converting the lyrics of a given music into a vector set according to preset rules.
- the preset lyrics encoding rules include: specifying that a single character in the lyrics is 1, a single punctuation mark is 0, and the characters are filled with 0.
- the model calculation module 20 is used to input a vector set of lyrics of a given music into a pre-built neural network model to obtain a time series distribution of the lyrics.
- the pre-built neural network model includes three layers of spatiotemporal convolutional neural networks (STCNNs) and one layer of bidirectional gated recurrent units (Bi-GRU).
- STCNNs spatiotemporal convolutional neural networks
- Bi-GRU bidirectional gated recurrent units
- the inputting a vector set X of lyrics of a given music into a pre-built neural network model to obtain a time series distribution of the lyrics includes:
- the two-way gating cycle unit uses the following formula to obtain the time step:
- u t and r t are the update gate and the reset gate respectively
- [] means the two vectors are connected
- * means matrix elements are multiplied
- ⁇ is the sigmoid function
- z ⁇ z 1 ,...
- z t ⁇ is Bi -GRU output characteristic of an input STCNNs i.e., W r and W u are reset and the update right door of the door weight, Represents the candidate state at time t
- Means The weight of h t is the output state at time t.
- mapping of the two directions of the two-way gated cyclic unit is:
- calculation formula of the time series distribution is:
- t is the time step
- z) softmax(mlp(h t ; W mlp ))
- the softmax is a normalized exponential function
- mlp is the feedforward neural network containing the weight W mlp
- Z is the output of the three-layer spatiotemporal convolutional network
- T is the number of all time steps.
- the rhythm generation module 30 is configured to: use the time sequence distribution to perform connection timing classification (Connectionist temporal classification, CTC) on the lyrics to obtain a target rhythm.
- connection timing classification Connectionist temporal classification, CTC
- the performing connection timing classification of the lyrics includes:
- V * is Perform the following operations to obtain 1) Combine consecutive identical symbols; 2) Remove blank characters;
- V * is the set of all paths
- z) represents the sum of the probabilities of the corresponding paths of the target lyrics set V
- z is the output of the three-layer spatiotemporal convolutional network Characteristic vector
- T is the number of all time steps
- z) is the time series distribution of all time steps T
- the expression needs Satisfies the condition that u is among all time steps T
- the maximum probability sum is calculated, and the target lyrics sequence h(x) corresponding to the input sequence is obtained, which is the rhythm generated by the target lyrics under the given music:
- an embodiment of the present application also proposes a computer-readable storage medium that stores a word-generated rhythm program on the computer-readable storage medium, and the word-generated rhythm program can be executed by one or more processors, To achieve the following operations:
- the lyrics are classified in connection time sequence to obtain the target rhythm.
- the specific implementation of the computer-readable storage medium of the present application is basically the same as the foregoing embodiments of the neural network-based device and method for generating rhythm from words, and will not be repeated here.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Molecular Biology (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Mathematical Physics (AREA)
- Evolutionary Computation (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Library & Information Science (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Databases & Information Systems (AREA)
- Auxiliary Devices For Music (AREA)
- Machine Translation (AREA)
- Electrophonic Musical Instruments (AREA)
Abstract
一种基于神经网络的以词生成节奏方法,涉及人工智能领域,该方法包括:将给定音乐的歌词按照预设的歌词编码规则转换为向量集合(S10);向预先构建的神经网络模型中输入给定音乐的歌词的向量集合,得到所述歌词的时间序列分布(S20);利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏(S30)。还提出一种基于神经网络的以词生成节奏装置以及一种计算机可读存储介质。将深度学习网络应用到音乐节奏的生成并可以得到可靠结果,使其生成的音乐更加符合原有音乐的规范。
Description
本申请基于巴黎公约申明享有2019年4月17日递交的申请号为CN201910307611.3、名称为“基于神经网络的以词生成节奏方法、装置及存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
本申请涉及人工智能技术领域,尤其涉及一种基于神经网络的以词生成节奏方法、装置及计算机可读存储介质。
音乐节奏是音乐自动生成算法中重要的一环,音乐节奏能够规范歌词的分布,同时能够约束音高、旋律等,是连接歌词和音乐的桥梁。传统的语音识别和音乐模型的构建,都是采用状态建模,一个音素或者一个字被人为的分成多个没有物理意义的状态,然后采用离散或者连续高斯模型描述每个状态的输出分布。这种建模方式需要预先对连续序列中间的建模单元的边界进行切分,并且输入输出分布边缘对齐,计算速度慢。
人们对于将深度神经网络与各个领域相结合做出了很多努力,在音乐生成方面,概率生成算法、马尔科夫链能够较准确的生成原有的音乐节奏,但生成的音乐节奏的旋律过于简单;长短期记忆网络(Long Short-Term Memory,LSTM)的结构模型过于复杂,模型的训练时间长;而循环神经网络(Recurrent Neural Network,RNN)在处理距离较远的序列时,很有可能会出现梯度消失的问题。因此,如何将深度学习网络应用到音乐节奏的生成并得到可靠结果使其生成的音乐更加符合原有音乐的规范,且使系统具备稳定的鲁棒性,是一个亟需解决的问题。
发明内容
本申请提供一种基于神经网络的以词生成节奏方法、装置及计算机可读存储介质,其主要目的在于提供一种将深度学习网络应用到音乐节奏的生成 的技术方案。
为实现上述目的,本申请提供的一种基于神经网络的以词生成节奏方法,包括:
将给定音乐的歌词按照预设的歌词编码规则转换为向量集合,其中,所述预设的歌词编码规则包括:规定歌词中的单个字符为1,单个标点符号为0,字符之间用0填充;
预先构建神经网络模型,其中,预先构建的所述神经网络模型包含三层时空卷积网络以及一层双向门控循环单元;
向所述三层时空卷积网络中输入给定音乐的歌词的向量集合,提取出特征向量;
利用所述双向门控循环单元对所述特征向量进行聚合操作,得到时间步长;及
对每一个时间步长进行线性变换,得到时间序列分布;
利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏。
此外,为实现上述目的,本申请还提供一种基于神经网络的以词生成节奏装置,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的以词生成节奏程序,所述以词生成节奏程序被所述处理器执行时实现一种基于神经网络的以词生成节奏的方法,所述方法包括:
将给定音乐的歌词按照预设的歌词编码规则转换为向量集合,其中,所述预设的歌词编码规则包括:规定歌词中的单个字符为1,单个标点符号为0,字符之间用0填充;
预先构建神经网络模型,其中,预先构建的所述神经网络模型包含三层时空卷积网络以及一层双向门控循环单元;
向所述三层时空卷积网络中输入给定音乐的歌词的向量集合,提取出特征向量;
利用所述双向门控循环单元对上所述特征向量进行聚合操作,得到时间步长;及
对每一个时间步长进行线性变换,得到时间序列分布;
利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述 计算机可读存储介质上存储有以词生成节奏程序,所述的以词生成节奏程序可被一个或者多个处理器执行,以实现如上所述的基于神经网络的以词生成节奏方法的步骤。
本申请提出的基于神经网络的以词生成节奏方法、装置及计算机可读存储介质,将给定音乐的歌词按照预设的歌词编码规则转换为向量集合;向预先构建的神经网络模型中输入给定音乐的歌词的向量集合,得到所述歌词的时间序列分布;利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏。因此,本申请将深度学习网络应用到音乐节奏的生成并可以得到可靠结果使其生成的音乐更加符合原有音乐的规范。
图1为本申请一实施例提供的基于神经网络的以词生成节奏方法的流程示意图;
图2为本申请一实施例提供的基于神经网络的以词生成节奏方法中所述的双向门控循环单元的示意图;
图3为本申请一实施例提供的基于神经网络的以词生成节奏方法中数据流的示意图;
图4为本申请一实施例提供的基于神经网络的以词生成节奏装置的内部结构示意图;
图5为本申请一实施例提供的基于神经网络的以词生成节奏装置中以词生成节奏程序的模块示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种基于神经网络的以词生成节奏方法。参照图1所示,为本申请一实施例提供的基于神经网络的以词生成节奏方法的流程示意图。该 方法可以由一个装置执行,该装置可以由软件和/或硬件实现。
在本实施例中,所述基于神经网络的以词生成节奏方法包括:
S10、将给定音乐的歌词按照预设的歌词编码规则转换为向量集合。
本申请较佳实施例中,所述预设的歌词编码规则包括:规定歌词中的单个字符为1,单个标点符号为0,字符之间用0填充。
本申请较佳实施例中,生成的向量形式为x
i=[time,1,1,channel]。其中,“time”为歌词出现在音乐中的时间的BCD码(Binary-Coded Decimal,亦称二进码十进数或二-十进制代码),“1”引申指的是图像的高和宽,在音乐中一个字符相当于一个像素,所以设置宽高均为1,“channel”为上述的歌词编码,如上所述单个字符的channel值为1,单个标点符号的channel值为0等。于是,给定音乐中的歌词可以转换为向量集合为X={x
1,…x
i,…x
t}。
S20、向预先构建的神经网络模型中输入给定音乐的歌词的向量集合,得到所述歌词的时间序列分布。
本申请所述预先构建的神经网络模型包含三层时空卷积网络(SpatioTemporal convolutional neural networks,STCNNs)以及一层双向门控循环单元(Bi-GRU,Bidirectional Gated Recurrent Unit)。
卷积神经网络(Convolutional Neural Networks,CNNs)是一种前馈神经网络,其可以在图像空间上进行卷积堆叠操作,有助于提高计算机视觉任务的性能。而所述时空卷积网络STCNNs可以通过在时间和空间维度上进行卷积运算从而可以对音视频数据进行处理。
本申请所述时空卷积网络STCNNs的每一层从输入到输出的计算方式为:
其中,y表示某一层的输出,σ表示激活函数,i,j,k表示样本上对应位置的坐标,
表示每一层输入到对应于上述(i,j,k)处与对应卷积核尺寸大小相等的局部区域,
表示卷积核的权重矩阵,b表示对应卷积核的偏置值。
在经过训练后,向所述三层时空卷积网络中输入给定音乐的歌词的向量 集合X后可以提取出特征向量z。
进一步地,本申请利用Bi-GRU进一步对STCNNs提取到的特征向量z进行进一步聚合,得到时间步长。
本申请较佳实施例在STCNNs后连接一层双向门控循环单元(Bi-GRU)。GRU是一种循环神经网络(RNN)的一种变体,GRU的重复单元模型如下,它有两个门,分别为更新门u
t和重置门r
t。更新门用于控制前一时刻的状态信息被带入到当前状态中的程度,更新门的值越大说明前一时刻的状态信息带入越多。重置门用于控制忽略前一时刻的状态信息的程度,重置门的值越小说明忽略得越多。而Bi-GRU主要特点是增加了对未来的学习能力,克服了仅能处理历史信息的缺陷。Bi-GRU将一个普通GRU拆成两个方向,一个按照序列顺序向前,一个逆时序反向,但是两个GRU连接同一个输入层和输出层,结构如图2所示。本申请较佳实施例中,所述Bi-GRU的神经元数为256个。
本申请所述Bi-GRU采用如下公式得到时间步长:
r
t=σ(W
r·[h
t-1,z]);
u
t=σ(W
u·[h
t-1,z]);
其中:u
t和r
t分别为更新门和重置门,[]表示两个向量相连接,*表示矩阵元素相乘,σ为sigmoid函数,z={z
1,…,z
t}为Bi-GRU的输入即STCNNs的输出特征,W
r和W
u分别为重置门和更新门的权重,
表示t时刻的候选状态,
表示
的权值,h
t为t时刻的输出状态。
Bi-GRU两个方向的映射分别为:
由此得到t时刻的时间步长为:
进一步地,本申请对每一个时间步长h
t进行线性变换,得到时间序列分布。
为了参数化序列分布,本申请对于对每一个时间步t,使得p(u
t|z)=softmax(mlp(h
t;W
mlp)),其中softmax是一种归一化指数函数,mlp是含有权重W
mlp的前馈神经网络,然后定义时间序列分布:
p(u
t,…,u
T|z)=∏
1≤t≤Tp(u
t|z),
在该模型中z为GRU的输入,即STCNNs的输出。即在输入为z时,将 t时刻的输出状态进行反向传输,得到对每个t时刻状态的分类。最终根据定义得到所有时间步长个数T(即为z的向量长度)的时间序列分布p。
S30、利用所述时间序列分布,对所述歌词进行连接时序分类(Connectionist temporal classification,CTC),得到目标节奏。
所述CTC是为RNN专门设计的顶层(top layer),用于序列学习所用,它可以消除输入与目标输出对齐的步骤。
本申请较佳实施例中,对所述歌词进行CTC的主要流程如下:
对于一个字符串序列y∈V
*,定义:
其中,V
*的所有元素被称为路径,V
*是所有路径的集合,p(y|z)代表目标歌词集合V对应路径的概率之和,z为所述三层时空卷积网络输出的特征向量,T为所有时间步长个数,p(u
t,…,u
T|z)为所有时间步长个数T的时间序列分布,s.t.|u|=T是一个条件函数,表述需要满足u是在所有时间步长T之中这个条件,B
-1(y)s.t.|u|=T表示长度为T且示经过函数B变换结果为字符串y的集合;
3)根据输入的特征向量z,计算最大概率和,得到输入序列对应的目标歌词序列h(x),即为目标歌词在给定音乐下生成的节奏:
综上所述,参阅图3所示,本申请的数据流如下:对于一段音乐,本申请较佳实施例将音乐中的歌词转换为向量,并将其传输到该构建的神经网络中得到时间序列,其中,本申请所述神经网络包括三层时空卷积网络以及一层双向门控循环单元;将得到的时间序列输入到连接时序分类当中,同时输入目标歌词,最终得到对应的目标歌词的序列则为这段音乐对应的目标歌词的节奏。
本申请还提供一种基于神经网络的以词生成节奏装置。参照图4所示, 为本申请一实施例提供的基于神经网络的以词生成节奏装置的内部结构示意图。
在本实施例中,基于神经网络的以词生成节奏装置1可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、便携计算机等终端设备。该基于神经网络的以词生成节奏装置1至少包括存储器11、处理器12,通信总线13,以及网络接口14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是基于神经网络的以词生成节奏装置1的内部存储单元,例如该基于神经网络的以词生成节奏装置1的硬盘。存储器11在另一些实施例中也可以是基于神经网络的以词生成节奏装置1的外部存储设备,例如基于神经网络的以词生成节奏装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括以词生成节奏装置1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于基于神经网络的以词生成节奏装置1的应用软件及各类数据,例如以词生成节奏程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行所述以词生成节奏程序01等。
通信总线13用于实现这些组件之间的连接通信。
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置1与其他电子设备之间建立通信连接。
可选地,该装置1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在基于神经网络的以词生成节奏装置1中处理的信息 以及用于显示可视化的用户界面。
图4仅示出了具有组件11-14以及以词生成节奏程序01的基于神经网络的以词生成节奏装置1,本领域技术人员可以理解的是,图4示出的结构并不构成对基于神经网络的以词生成节奏装置1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
在图4所示的装置1实施例中,存储器11中存储有以词生成节奏程序01;处理器12执行存储器11中存储的以词生成节奏程序01时实现如下步骤:
步骤一、将给定音乐的歌词按照预设的歌词编码规则转换为向量集合。
本申请较佳实施例中,所述预设的歌词编码规则包括:规定歌词中的单个字符为1,单个标点符号为0,字符之间用0填充。
本申请较佳实施例中,生成的向量形式为x
i=[time,1,1,channel]。其中,“time”为歌词出现在音乐中的时间的BCD码(Binary-Coded Decimal,亦称二进码十进数或二-十进制代码),“1”引申指的是图像的高和宽,在音乐中一个字符相当于一个像素,所以设置宽高均为1,“channel”为上述的歌词编码,如上所述单个字符的channel值为1,单个标点符号的channel值为0等。于是,给定音乐中的歌词可以转换为向量集合为X={x
1,…x
i,…x
t}。
步骤二、向预先构建的神经网络模型中输入给定音乐的歌词的向量集合,得到所述歌词的时间序列分布。
本申请所述预先构建的神经网络模型包含三层时空卷积网络(SpatioTemporal convolutional neural networks,STCNNs)以及一层双向门控循环单元(Bi-GRU,Bidirectional Gated Recurrent Unit)。
卷积神经网络(Convolutional Neural Networks,CNNs)是一种前馈神经网络,其可以在图像空间上进行卷积堆叠操作,有助于提高计算机视觉任务的性能。而所述时空卷积网络STCNNs可以通过在时间和空间维度上进行卷积运算从而可以对音视频数据进行处理。
本申请所述时空卷积网络STCNNs的每一层从输入到输出的计算方式为:
其中,y表示某一层的输出,σ表示激活函数,i,j,k表示样本上对应位置的坐标,
表示每一层输入到对应于上述(i,j,k)处与对应卷积核尺寸大小相等的局部区域,
表示卷积核的权重矩阵,b表示对应卷积核的偏置值。
在经过训练后,向所述三层时空卷积网络中输入给定音乐的歌词的向量集合X后可以提取出特征向量z。
进一步地,本申请利用Bi-GRU进一步对STCNNs提取到的特征向量z进行进一步聚合,得到时间步长。
本申请较佳实施例在STCNNs后连接一层双向门控循环单元(Bi-GRU)。GRU是一种循环神经网络(RNN)的一种变体,GRU的重复单元模型如下,它有两个门,分别为更新门u
t和重置门r
t。更新门用于控制前一时刻的状态信息被带入到当前状态中的程度,更新门的值越大说明前一时刻的状态信息带入越多。重置门用于控制忽略前一时刻的状态信息的程度,重置门的值越小说明忽略得越多。而Bi-GRU主要特点是增加了对未来的学习能力,克服了仅能处理历史信息的缺陷。Bi-GRU将一个普通GRU拆成两个方向,一个按照序列顺序向前,一个逆时序反向,但是两个GRU连接同一个输入层和输出层,结构如图2所示。本申请较佳实施例中,所述Bi-GRU的神经元数为256个。
本申请所述Bi-GRU采用如下公式得到时间步长:
r
t=σ(W
r·[h
t-1,z]);
u
t=σ(W
u·[h
t-1,z]);
其中:u
t和r
t分别为更新门和重置门,[]表示两个向量相连接,*表示矩阵元素相乘,σ为sigmoid函数,z={z
1,…,z
t}为Bi-GRU的输入即STCNNs的输出特征,W
r和W
u分别为重置门和更新门的权重,
表示t时刻的候选状态,
表示
的权值,h
t为t时刻的输出状态。
Bi-GRU两个方向的映射分别为:
由此得到t时刻的时间步长为:
进一步地,本申请对每一个时间步长h
t进行线性变换,得到时间序列分布。
为了参数化序列分布,本申请对于对每一个时间步t,使得p(u
t|z)=softmax(mlp(h
t;W
mlp)),其中softmax是一种归一化指数函数,mlp是含有权重W
mlp的前馈神经网络,然后定义时间序列分布:
p(u
t,…,u
T|z)=∏
1≤t≤Tp(u
t|z),
在该模型中z为GRU的输入,即STCNNs的输出。即在输入为z时,将t时刻的输出状态进行反向传输,得到对每个t时刻状态的分类。最终根据定义得到所有时间步长个数T(即为z的向量长度)的时间序列分布p。
步骤三、利用所述时间序列分布,对所述歌词进行连接时序分类(Connectionist temporal classification,CTC),得到目标节奏。
所述CTC是为RNN专门设计的顶层(top layer),用于序列学习所用,它可以消除输入与目标输出对齐的步骤。
本申请较佳实施例中,对所述歌词进行CTC的主要流程如下:
对于一个字符串序列y∈V
*,定义:
其中,V
*的所有元素被称为路径,V
*是所有路径的集合,p(y|z)代表目标歌词集合V对应路径的概率之和,z为所述三层时空卷积网络输出的特征向量,T为所有时间步长个数,p(u
t,…,u
T|z)为所有时间步长个数T的时间序列分布,s.t.|u|=T是一个条件函数,表述需要满足u是在所有时间步长T之中这个条件,B
-1(y)s.t.|u|=T表示长度为T且示经过函数B变换结果为字符串y的集合;
3)根据输入的特征向量z,计算最大概率和,得到输入序列对应的目标歌词序列h(x),即为目标歌词在给定音乐下生成的节奏:
可选地,在其他实施例中,所述的以词生成节奏程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个 处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述以词生成节奏程序在基于神经网络的以词生成节奏装置中的执行过程。
例如,参照图5所示,为本申请基于神经网络的以词生成节奏装置一实施例中的以词生成节奏程序的程序模块示意图,该实施例中,以词生成节奏程序01可以被分割为歌词转换模块10、模型计算模块20、节奏生成模块30,示例性地:
歌词转换模块10用于:将给定音乐的歌词按照预设的规则转换为向量集合。
可选地,所述预设的歌词编码规则,包括:规定歌词中的单个字符为1,单个标点符号为0,字符之间用0填充。
模型计算模块20用于:向预先构建的神经网络模型中输入给定音乐的歌词的向量集合,得到所述歌词的时间序列分布。
可选地,所述预先构建的神经网络模型包含三层时空卷积网络(SpatioTemporal convolutional neural networks,STCNNs)以及一层双向门控循环单元(Bi-GRU,Bidirectional Gated Recurrent Unit)。
可选地,所述向预先构建的神经网络模型中输入给定音乐的歌词的向量集合X,得到所述歌词的时间序列分布,包括:
向所述三层时空卷积网络中输入给定音乐的歌词的向量集合X,提取出特征向量z;
利用所述双向门控循环单元对上述提取到的特征向量z进行聚合操作,得到时间步长;
对每一个时间步长h
t进行线性变换,得到时间序列分布。
可选地,所述双向门控循环单元采用如下公式得到时间步长:
r
t=σ(W
r·[h
t-1,z]);
u
t=σ(W
u·[h
t-1,z]);
其中:u
t和r
t分别为更新门和重置门,[]表示两个向量相连接,*表示矩阵元素相乘,σ为sigmoid函数,z={z
1,…,z
t}为Bi-GRU的输入即STCNNs的输出特征,W
r和W
u分别为重置门和更新门的权重,
表示t时刻的候选状 态,
表示
的权值,h
t为t时刻的输出状态。
双向门控循环单元两个方向的映射分别为:
由此得到t时刻的时间步长为:
可选地,所述时间序列分布的计算公式为:
p(u
t,…,u
T|z)=∏
1≤t≤Tp(u
t|z),
其中,t为时间步,p(u
t|z)=softmax(mlp(h
t;W
mlp)),所述softmax是一种归一化指数函数,mlp是含有权重W
mlp的前馈神经网络,z为三层时空卷积网络的输出,T为所有时间步长个数。
节奏生成模块30用于:利用所述时间序列分布,对所述歌词进行连接时序分类(Connectionist temporal classification,CTC),得到目标节奏。
可选地,所述对所述歌词进行连接时序分类包括:
对于一个字符串序列y∈V
*,定义:
其中,V
*的所有元素被称为路径,V
*是所有路径的集合,p(y|z)代表目标歌词集合V对应路径的概率之和,z为所述三层时空卷积网络输出的特征向量,T为所有时间步长个数,p(u
t,…,u
T|z)为所有时间步长个数T的时间序列分布,s.t.|u|=T是一个条件函数,表述需要满足u是在所有时间步长T之中这个条件,B
-1(y)s.t.|u|=T表示长度为T且示经过函数B变换结果为字符串y的集合;
根据输入的特征向量z,计算最大概率和,得到输入序列对应的目标歌词序列h(x),即为目标歌词在给定音乐下生成的节奏:
上述歌词转换模块10、模型计算模块20、节奏生成模块30等程序模块 被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有以词生成节奏程序,所述的以词生成节奏程序可被一个或多个处理器执行,以实现如下操作:
将给定音乐的歌词按照预设的规则转换为向量集合;
向预先构建的神经网络模型中输入给定音乐的歌词的向量集合,得到所述歌词的时间序列分布;
利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏。
本申请计算机可读存储介质具体实施方式与上述基于神经网络的以词生成节奏装置和方法各实施例基本相同,在此不作累述。
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。
Claims (20)
- 一种基于神经网络的以词生成节奏方法,其特征在于,所述方法包括:将给定音乐的歌词按照预设的歌词编码规则转换为向量集合,其中,所述预设的歌词编码规则包括:规定歌词中的单个字符为1,单个标点符号为0,字符之间用0填充;预先构建神经网络模型,其中,预先构建的所述神经网络模型包含三层时空卷积网络以及一层双向门控循环单元;向所述三层时空卷积网络中输入给定音乐的歌词的向量集合,提取出特征向量;利用所述双向门控循环单元对所述特征向量进行聚合操作,得到时间步长;及对每一个时间步长进行线性变换,得到时间序列分布;利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏。
- 如权利要求1所述的基于神经网络的以词生成节奏方法,其特征在于,所述利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏,包括:对于一个字符串序列y∈V *,定义:其中,V *的所有元素被称为路径,V *是所有路径的集合,p(y|z)代表目标歌词集合V对应路径的概率之和,z为所述三层时空卷积网络输出的特征向量,T为所有时间步长个数,p(u t,…,u T|z)为所有时间步长个数T的时间序列分布,s.t.|u|=T是一个条件函数,表述需要满足u是在所有时间步长T之中这个条件,B -1(y)s.t.|u|=T表示长度为T且示经过函数B变换结果为字符串y的集合;根据输入的特征向量z,计算最大概率和,得到输入序列对应的目标歌词序列h(x),即为目标歌词在给定音乐下生成的节奏:
- 如权利要求1所述的基于神经网络的以词生成节奏方法,其特征在于,所述双向门控循环单元连接在所述三层时空卷积网络后,所述双向门控循环单元的神经元数为256个。
- 如权利要求1至6中的任意一项所述的基于神经网络的以词生成节奏 方法,其特征在于,所述时间序列分布的计算公式为:p(u t,…,u T|z)=∏ 1≤t≤Tp(u t|z),其中,t为时间步长,p(u t|z)=softmax(mlp(h t;W mlp)),所述softmax是一种归一化指数函数,mlp是含有权重W mlp的前馈神经网络,z为三层时空卷积网络输出的特征向量,T为所有时间步长个数。
- 一种基于神经网络的以词生成节奏装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的以词生成节奏程序,所述以词生成节奏程序被所述处理器执行时实现一种基于神经网络的以词生成节奏的方法,所述方法包括:将给定音乐的歌词按照预设的歌词编码规则转换为向量集合,其中,所述预设的歌词编码规则包括:规定歌词中的单个字符为1,单个标点符号为0,字符之间用0填充;预先构建神经网络模型,其中,预先构建的所述神经网络模型包含三层时空卷积网络以及一层双向门控循环单元;向所述三层时空卷积网络中输入给定音乐的歌词的向量集合,提取出特征向量;利用所述双向门控循环单元对所述特征向量进行聚合操作,得到时间步长;及对每一个时间步长进行线性变换,得到时间序列分布;利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏。
- 如权利要求8所述的基于神经网络的以词生成节奏装置,其特征在于,所述利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏,包括:对于一个字符串序列y∈V *,定义:其中,V *的所有元素被称为路径,V *是所有路径的集合,p(y|z)代表目标歌词集合V对应路径的概率之和,z为所述三层时空卷积网络输出的特征向量,T为所有时间步长个数,p(u t,…,u T|z)为所有时间步长个数T的时间序列分布,s.t.|u|=T是一个条件函数,表述需要满足u是在所有时间步长T之中这个条件,B -1(y)s.t.|u|=T表示长度为T且示经过函数B变换结果为字符串y的集合;根据输入的特征向量z,计算最大概率和,得到输入序列对应的目标歌词序列h(x),即为目标歌词在给定音乐下生成的节奏:
- 如权利要求8所述的基于神经网络的以词生成节奏装置,其特征在于,所述双向门控循环单元连接在所述三层时空卷积网络后,所述双向门控循环单元的神经元数为256个。
- 如权利要求8至13中的任意一项所述的基于神经网络的以词生成节奏装置,其特征在于,所述时间序列分布的计算公式为:p(u t,…,u T|z)=∏ 1≤t≤Tp(u t|z),其中,t为时间步长,p(u t|z)=softmax(mlp(h t;W mlp)),所述softmax是一种归一化指数函数,mlp是含有权重W mlp的前馈神经网络,z为三层时空卷积网络输出的特征向量,T为所有时间步长个数。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有以词生成节奏程序,所述的以词生成节奏程序可被一个或者多个处理器执行,以实现如下步骤:将给定音乐的歌词按照预设的歌词编码规则转换为向量集合,其中,所述预设的歌词编码规则包括:规定歌词中的单个字符为1,单个标点符号为0,字符之间用0填充;预先构建神经网络模型,其中,预先构建的所述神经网络模型包含三层时空卷积网络以及一层双向门控循环单元;向所述三层时空卷积网络中输入给定音乐的歌词的向量集合,提取出特征向量;利用所述双向门控循环单元对所述特征向量进行聚合操作,得到时间步长;及对每一个时间步长进行线性变换,得到时间序列分布;利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏。
- 如权利要求15所述的计算机可读存储介质,其特征在于,所述利用所述时间序列分布,对所述歌词进行连接时序分类,得到目标节奏,包括:对于一个字符串序列y∈V *,定义:其中,V *的所有元素被称为路径,V *是所有路径的集合,p(y|z)代表目标歌词集合V对应路径的概率之和,z为所述三层时空卷积网络输出的特征向量,T为所有时间步长个数,p(u t,…,u T|z)为所有时间步长个数T的时间序列分布,s.t.|u|=T是一个条件函数,表述需要满足u是在所有时间步长T之中这个条件,B -1(y)s.t.|u|=T表示长度为T且示经过函数B变换结果为字符串y的集合;根据输入的特征向量z,计算最大概率和,得到输入序列对应的目标歌词序列h(x),即为目标歌词在给定音乐下生成的节奏:
- 如权利要求15所述的计算机可读存储介质,其特征在于,所述双向门控循环单元连接在所述三层时空卷积网络后,所述双向门控循环单元的神经元数为256个。
- 如权利要求15至19中的任意一项所述的计算机可读存储介质,其特征在于,所述时间序列分布的计算公式为:p(u t,…,u T|z)=∏ 1≤t≤Tp(u t|z),其中,t为时间步长,p(u t|z)=softmax(mlp(h t;W mlp)),所述softmax是一种归一化指数函数,mlp是含有权重W mlp的前馈神经网络,z为三层时空卷积网络输出的特征向量,T为所有时间步长个数。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910307611.3 | 2019-04-17 | ||
| CN201910307611.3A CN110222226B (zh) | 2019-04-17 | 2019-04-17 | 基于神经网络的以词生成节奏的方法、装置及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020211237A1 true WO2020211237A1 (zh) | 2020-10-22 |
Family
ID=67822589
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/102189 Ceased WO2020211237A1 (zh) | 2019-04-17 | 2019-08-23 | 基于神经网络的以词生成节奏的方法、装置及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110222226B (zh) |
| WO (1) | WO2020211237A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113066457A (zh) * | 2021-03-17 | 2021-07-02 | 平安科技(深圳)有限公司 | 梵叹音乐生成方法、装置、设备及存储介质 |
| CN117012058A (zh) * | 2023-08-04 | 2023-11-07 | 泉州凯睿天成教育科技有限公司 | 一种可视化视频教育培训系统 |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110853604A (zh) * | 2019-10-30 | 2020-02-28 | 西安交通大学 | 基于变分自编码器的具有特定地域风格的中国民歌自动生成方法 |
| GB2596607B (en) * | 2020-07-03 | 2024-01-03 | Imagination Tech Ltd | Methods and systems for running dynamic recurrent neural networks in hardware |
| CN115112141B (zh) * | 2022-06-24 | 2025-01-10 | 重庆长安汽车股份有限公司 | 一种车辆路径规划方法、系统、电子设备及存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8874249B2 (en) * | 2011-01-24 | 2014-10-28 | International Business Machines Corporation | Discrete sampling based nonlinear control system |
| CN108509534A (zh) * | 2018-03-15 | 2018-09-07 | 华南理工大学 | 基于深度学习的个性化音乐推荐系统及其实现方法 |
| CN109346045A (zh) * | 2018-10-26 | 2019-02-15 | 平安科技(深圳)有限公司 | 基于长短时神经网络的多声部音乐生成方法及装置 |
| CN109637509A (zh) * | 2018-11-12 | 2019-04-16 | 平安科技(深圳)有限公司 | 一种音乐自动生成方法、装置及计算机可读存储介质 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10606548B2 (en) * | 2017-06-16 | 2020-03-31 | Krotos Ltd | Method of generating an audio signal |
| KR101934057B1 (ko) * | 2017-09-08 | 2019-04-08 | 한성대학교 산학협력단 | 계층적 인공 신경망을 이용한 자동 작곡 방법 및 그 기록 매체 |
| CN108717856B (zh) * | 2018-06-16 | 2022-03-08 | 台州学院 | 一种基于多尺度深度卷积循环神经网络的语音情感识别方法 |
| CN109166564B (zh) * | 2018-07-19 | 2023-06-06 | 平安科技(深圳)有限公司 | 为歌词文本生成乐曲的方法、装置及计算机可读存储介质 |
| CN109471951B (zh) * | 2018-09-19 | 2023-06-02 | 平安科技(深圳)有限公司 | 基于神经网络的歌词生成方法、装置、设备和存储介质 |
-
2019
- 2019-04-17 CN CN201910307611.3A patent/CN110222226B/zh active Active
- 2019-08-23 WO PCT/CN2019/102189 patent/WO2020211237A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8874249B2 (en) * | 2011-01-24 | 2014-10-28 | International Business Machines Corporation | Discrete sampling based nonlinear control system |
| CN108509534A (zh) * | 2018-03-15 | 2018-09-07 | 华南理工大学 | 基于深度学习的个性化音乐推荐系统及其实现方法 |
| CN109346045A (zh) * | 2018-10-26 | 2019-02-15 | 平安科技(深圳)有限公司 | 基于长短时神经网络的多声部音乐生成方法及装置 |
| CN109637509A (zh) * | 2018-11-12 | 2019-04-16 | 平安科技(深圳)有限公司 | 一种音乐自动生成方法、装置及计算机可读存储介质 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113066457A (zh) * | 2021-03-17 | 2021-07-02 | 平安科技(深圳)有限公司 | 梵叹音乐生成方法、装置、设备及存储介质 |
| CN113066457B (zh) * | 2021-03-17 | 2023-11-03 | 平安科技(深圳)有限公司 | 梵叹音乐生成方法、装置、设备及存储介质 |
| CN117012058A (zh) * | 2023-08-04 | 2023-11-07 | 泉州凯睿天成教育科技有限公司 | 一种可视化视频教育培训系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110222226A (zh) | 2019-09-10 |
| CN110222226B (zh) | 2024-03-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020211237A1 (zh) | 基于神经网络的以词生成节奏的方法、装置及存储介质 | |
| CN111797893B (zh) | 一种神经网络的训练方法、图像分类系统及相关设备 | |
| CN108830277B (zh) | 语义分割模型的训练方法、装置、计算机设备和存储介质 | |
| CN113095415B (zh) | 一种基于多模态注意力机制的跨模态哈希方法及系统 | |
| CN112288075B (zh) | 一种数据处理方法及相关设备 | |
| CN109934173B (zh) | 表情识别方法、装置及电子设备 | |
| WO2021159714A1 (zh) | 一种数据处理方法及相关设备 | |
| WO2021169116A1 (zh) | 智能化的缺失数据填充方法、装置、设备及存储介质 | |
| WO2021047286A1 (zh) | 文本处理模型的训练方法、文本处理方法及装置 | |
| WO2023134082A1 (zh) | 图像描述语句生成模块的训练方法及装置、电子设备 | |
| EP4390753A1 (en) | Text data processing method, neural network training method, and related devices | |
| CN112308237B (zh) | 一种问答数据增强方法、装置、计算机设备及存储介质 | |
| WO2021238333A1 (zh) | 一种文本处理网络、神经网络训练的方法以及相关设备 | |
| CN111522965A (zh) | 一种基于迁移学习的实体关系抽取的问答方法及系统 | |
| WO2020244475A1 (zh) | 用于语言序列标注的方法、装置、存储介质及计算设备 | |
| CN116821373B (zh) | 基于图谱的prompt推荐方法、装置、设备及介质 | |
| US11830275B1 (en) | Person re-identification method and apparatus, device, and readable storage medium | |
| WO2021027117A1 (zh) | 语音情绪识别方法、装置及计算机可读存储介质 | |
| CN113609819B (zh) | 标点符号确定模型及确定方法 | |
| US11941035B2 (en) | Summary generation model training method, apparatus, electronic device and non-transitory computer readable storage medium | |
| CN113657092B (zh) | 识别标签的方法、装置、设备以及介质 | |
| WO2020224099A1 (zh) | 智能化情感问答方法、装置及计算机可读存储介质 | |
| CN114898426B (zh) | 一种同义标签聚合方法、装置、设备及存储介质 | |
| CN113961701B (zh) | 消息文本的聚类方法及装置 | |
| CN118504571B (zh) | 一种基于sdt-mcm的重叠实体关系抽取方法、装置、设备及介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19924905 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19924905 Country of ref document: EP Kind code of ref document: A1 |














