a38a14f46715b7b0411d89c2e86854cf074c05a2,tslearn/shapelets.py,ShapeletModel,_set_model_layers,#ShapeletModel#Any#Any#Any#,310
Before Change
shapelet_sizes = sorted(self.n_shapelets_per_size.keys())
pool_layers = []
for i, sz in enumerate(sorted(shapelet_sizes)):
transformer_layer = Conv1D(filters=sz,
kernel_size=sz,
trainable=False,
use_bias=False,
name="false_conv_%d" % i)(inputs)
shapelet_layer = LocalSquaredDistanceLayer(self.n_shapelets_per_size[sz],
name="shapelets_%d" % i)(transformer_layer)
pool_layers.append(GlobalMinPooling1D(name="min_pooling_%d" % i)(shapelet_layer))
if len(shapelet_sizes) > 1:
After Change
self.model.get_layer("false_conv_%d_%d" % (i, di)).set_weights([numpy.eye(sz).reshape((sz, 1, sz))])
def _set_model_layers(self, ts_sz, d, n_classes):
inputs = [Input(shape=(ts_sz, 1), name="input_%d" % di) for di in range(d)]
shapelet_sizes = sorted(self.n_shapelets_per_size.keys())
pool_layers = []
for i, sz in enumerate(sorted(shapelet_sizes)):
transformer_layers = [Conv1D(filters=sz,
kernel_size=sz,
trainable=False,
use_bias=False,
name="false_conv_%d_%d" % (i, di))(inputs[di]) for di in range(d)]
shapelet_layers = [LocalSquaredDistanceLayer(self.n_shapelets_per_size[sz],
name="shapelets_%d_%d" % (i, di))(transformer_layers[di])
for di in range(d)]
if d == 1:
summed_shapelet_layer = shapelet_layers[0]
else:
summed_shapelet_layer = add(shapelet_layers)
pool_layers.append(GlobalMinPooling1D(name="min_pooling_%d" % i)(summed_shapelet_layer))
if len(shapelet_sizes) > 1:
concatenated_features = concatenate(pool_layers)
else:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: rtavenar/tslearn
Commit Name: a38a14f46715b7b0411d89c2e86854cf074c05a2
Time: 2017-09-22
Author: romain.tavenard@univ-rennes2.fr
File Name: tslearn/shapelets.py
Class Name: ShapeletModel
Method Name: _set_model_layers
Project Name: nl8590687/ASRT_SpeechRecognition
Commit Name: 5f73fe0599380479a37029de1d5647f33aae18c8
Time: 2017-09-04
Author: 3210346136@qq.com
File Name: main.py
Class Name: ModelSpeech
Method Name: CreateModel
Project Name: deepchem/deepchem
Commit Name: b68db1aaf6abe4d2cea8321cc6f1564228dd60f5
Time: 2019-05-31
Author: peastman@stanford.edu
File Name: deepchem/models/tensorgraph/models/seqtoseq.py
Class Name: AspuruGuzikAutoEncoder
Method Name: _create_encoder