Comments (3)
Hi,
This is a problem caused by the network failing to converge. The one in the repository at the moment is very sensitive and is prone to generalizing to the same note.
You can replace it with this similar model:
model = Sequential()
model.add(LSTM(
512,
input_shape=(network_input.shape[1], network_input.shape[2]),
recurrent_dropout=0.3,
return_sequences=True
))
model.add(LSTM(512, return_sequences=True, recurrent_dropout=0.3,))
model.add(LSTM(512))
model.add(BatchNormalization())
model.add(Dropout(0.3))
model.add(Dense(256))
model.add(Activation('relu'))
model.add(BatchNormalization())
model.add(Dropout(0.3))
model.add(Dense(n_vocab))
model.add(Activation('softmax'))
model.compile(loss='categorical_crossentropy', optimizer='rmsprop')
The differences are:
- We're using recurrent_dropout instead of regular dropout for the LSTM layers. This is because using regular dropout in between recurrent layers such as LSTM can actually harm the performance of the model
- Added BatchNormalization which helps normalize the outputs of layers and helps the model converge. In my experience it almost always prevents the model from generalizing to one note
from classical-piano-composer.
I will be updating the repository and the article later today since I finally have the time to do it.
from classical-piano-composer.
I have the same issue with the updated model, though I ran it on my own MIDI files of Bach music and tried 50 epochs because I'm running it on my home laptop. I'll see how the full 200 epochs works.
from classical-piano-composer.
Related Issues (20)
- A few issues (with solutions)
- Only one track, playing HOT 7
- Using weights trained on anohter computer HOT 1
- Nevermind
- randomSeed
- data file HOT 1
- ValueError(Shape error)
- ValueError(Shape error) while running predict.py iam getting this error. Anyone can help me,Thanks in advance HOT 15
- Can't Run with Tensorflow-gpu HOT 3
- Question about Parts used from the midi files
- Stuck on I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version HOT 2
- Accepting PRs?
- Alternate Instruments HOT 4
- np_utils is not defined
- music21.exceptions21.StreamException: HOT 3
- failed to find TimeSignature in meterStream; cannot process Measures HOT 1
- MIDI generated is just one note repeated HOT 4
- offset should be += 1 not += 0.5 in predict.py
- data/notes not found
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from classical-piano-composer.