tyo-yo / seqgan Goto Github PK
View Code? Open in Web Editor NEWSeqGAN with keras
License: MIT License
SeqGAN with keras
License: MIT License
Hello,
I tried to run the main notebook but while running this cell:
trainer = Trainer(B, T, g_E, g_H, d_E, d_filter_sizes, d_num_filters, d_dropout,d_lr=d_lr, n_sample=n_sample, generate_samples=generate_samples)
I am getting this error:
`TypeError Traceback (most recent call last)
in
----> 1 trainer = Trainer(B, T, g_E, g_H, d_E, d_filter_sizes, d_num_filters, d_dropout,d_lr=d_lr, n_sample=n_sample, generate_samples=generate_samples)
F:\seqGAN\SeqGAN-keras\SeqGAN\train.py in init(self, B, T, g_E, g_H, d_E, d_H, d_dropout, g_lr, d_lr, n_sample, generate_samples, init_eps)
43 print(self.V, d_E, d_H, d_dropout)
44
---> 45 self.discriminator = Discriminator(self.V, d_E, d_H, d_dropout)
46 self.env = Environment(self.discriminator, self.g_data, self.g_beta, n_sample=n_sample)
47
F:\seqGAN\SeqGAN-keras\SeqGAN\models.py in Discriminator(V, E, H, dropout)
279 embedding_out = K.reshape(out, [32, 25, E])
280 print(E)
--> 281 out = LSTM(H)(embedding_out, return_sequences=True, input_shape=(32, 25, E))
282 out = Highway(out, num_layers=1)
283 out = Dropout(dropout, name='Dropout')(out)
~\Anaconda3\lib\site-packages\keras\layers\recurrent.py in call(self, inputs, initial_state, constants, **kwargs)
498
499 if initial_state is None and constants is None:
--> 500 return super(RNN, self).call(inputs, **kwargs)
501
502 # If any of initial_state
or constants
are specified and are Keras
~\Anaconda3\lib\site-packages\keras\engine\base_layer.py in call(self, inputs, **kwargs)
429 'You can build it manually via: '
430 'layer.build(batch_input_shape)
')
--> 431 self.build(unpack_singleton(input_shapes))
432 self.built = True
433
~\Anaconda3\lib\site-packages\keras\layers\recurrent.py in build(self, input_shape)
459 self.cell.build([step_input_shape] + constants_shape)
460 else:
--> 461 self.cell.build(step_input_shape)
462
463 # set or validate state_spec
~\Anaconda3\lib\site-packages\keras\layers\recurrent.py in build(self, input_shape)
1797 initializer=self.kernel_initializer,
1798 regularizer=self.kernel_regularizer,
-> 1799 constraint=self.kernel_constraint)
1800 self.recurrent_kernel = self.add_weight(
1801 shape=(self.units, self.units * 4),
~\Anaconda3\lib\site-packages\keras\legacy\interfaces.py in wrapper(*args, **kwargs)
89 warnings.warn('Update your ' + object_name + 90 '
call to the Keras 2 API: ' + signature, stacklevel=2)
---> 91 return func(*args, **kwargs)
92 wrapper._original_function = func
93 return wrapper
~\Anaconda3\lib\site-packages\keras\engine\base_layer.py in add_weight(self, name, shape, dtype, initializer, regularizer, trainable, constraint)
247 if dtype is None:
248 dtype = K.floatx()
--> 249 weight = K.variable(initializer(shape),
250 dtype=dtype,
251 name=name,
~\Anaconda3\lib\site-packages\keras\initializers.py in call(self, shape, dtype)
207 scale /= max(1., fan_out)
208 else:
--> 209 scale /= max(1., float(fan_in + fan_out) / 2)
210 if self.distribution == 'normal':
211 # 0.879... = scipy.stats.truncnorm.std(a=-2, b=2, loc=0., scale=1.)
TypeError: unsupported operand type(s) for +: 'int' and 'list'
`
What should I do?
I have a set of 1D wave signals, and I'd like to generate more by SeqGAN, it is possible? If so, how to set the input (just numbers)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.