You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
270 lines
7.5 KiB
270 lines
7.5 KiB
2 years ago
|
window.modelJSON = {
|
||
|
format: 'layers-model',
|
||
|
generatedBy: 'keras v2.4.0',
|
||
|
convertedBy: 'TensorFlow.js Converter v3.7.0',
|
||
|
modelTopology: {
|
||
|
keras_version: '2.4.0',
|
||
|
backend: 'tensorflow',
|
||
|
model_config: {
|
||
|
class_name: 'Sequential',
|
||
|
config: {
|
||
|
name: 'sequential',
|
||
|
layers: [
|
||
|
{
|
||
|
class_name: 'InputLayer',
|
||
|
config: {
|
||
|
batch_input_shape: [null, null, 80, 1],
|
||
|
dtype: 'float32',
|
||
|
sparse: false,
|
||
|
ragged: false,
|
||
|
name: 'conv2d_input'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
class_name: 'Conv2D',
|
||
|
config: {
|
||
|
name: 'conv2d',
|
||
|
trainable: true,
|
||
|
batch_input_shape: [null, null, 80, 1],
|
||
|
dtype: 'float32',
|
||
|
filters: 40,
|
||
|
kernel_size: [3, 3],
|
||
|
strides: [1, 1],
|
||
|
padding: 'same',
|
||
|
data_format: 'channels_last',
|
||
|
dilation_rate: [1, 1],
|
||
|
groups: 1,
|
||
|
activation: 'relu',
|
||
|
use_bias: true,
|
||
|
kernel_initializer: {
|
||
|
class_name: 'GlorotUniform',
|
||
|
config: { seed: null }
|
||
|
},
|
||
|
bias_initializer: { class_name: 'Zeros', config: {} },
|
||
|
kernel_regularizer: null,
|
||
|
bias_regularizer: null,
|
||
|
activity_regularizer: null,
|
||
|
kernel_constraint: null,
|
||
|
bias_constraint: null
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
class_name: 'MaxPooling2D',
|
||
|
config: {
|
||
|
name: 'max_pooling2d',
|
||
|
trainable: true,
|
||
|
dtype: 'float32',
|
||
|
pool_size: [2, 2],
|
||
|
padding: 'same',
|
||
|
strides: [2, 2],
|
||
|
data_format: 'channels_last'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
class_name: 'Conv2D',
|
||
|
config: {
|
||
|
name: 'conv2d_1',
|
||
|
trainable: true,
|
||
|
dtype: 'float32',
|
||
|
filters: 60,
|
||
|
kernel_size: [3, 3],
|
||
|
strides: [1, 1],
|
||
|
padding: 'same',
|
||
|
data_format: 'channels_last',
|
||
|
dilation_rate: [1, 1],
|
||
|
groups: 1,
|
||
|
activation: 'relu',
|
||
|
use_bias: true,
|
||
|
kernel_initializer: {
|
||
|
class_name: 'GlorotUniform',
|
||
|
config: { seed: null }
|
||
|
},
|
||
|
bias_initializer: { class_name: 'Zeros', config: {} },
|
||
|
kernel_regularizer: null,
|
||
|
bias_regularizer: null,
|
||
|
activity_regularizer: null,
|
||
|
kernel_constraint: null,
|
||
|
bias_constraint: null
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
class_name: 'MaxPooling2D',
|
||
|
config: {
|
||
|
name: 'max_pooling2d_1',
|
||
|
trainable: true,
|
||
|
dtype: 'float32',
|
||
|
pool_size: [2, 2],
|
||
|
padding: 'same',
|
||
|
strides: [2, 2],
|
||
|
data_format: 'channels_last'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
class_name: 'Reshape',
|
||
|
config: {
|
||
|
name: 'reshape',
|
||
|
trainable: true,
|
||
|
dtype: 'float32',
|
||
|
target_shape: [-1, 1200]
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
class_name: 'Bidirectional',
|
||
|
config: {
|
||
|
name: 'bidi',
|
||
|
trainable: true,
|
||
|
dtype: 'float32',
|
||
|
layer: {
|
||
|
class_name: 'LSTM',
|
||
|
config: {
|
||
|
name: 'lstm',
|
||
|
trainable: true,
|
||
|
dtype: 'float32',
|
||
|
return_sequences: true,
|
||
|
return_state: false,
|
||
|
go_backwards: false,
|
||
|
stateful: false,
|
||
|
unroll: false,
|
||
|
time_major: false,
|
||
|
units: 200,
|
||
|
activation: 'tanh',
|
||
|
recurrent_activation: 'sigmoid',
|
||
|
use_bias: true,
|
||
|
kernel_initializer: {
|
||
|
class_name: 'GlorotUniform',
|
||
|
config: { seed: null }
|
||
|
},
|
||
|
recurrent_initializer: {
|
||
|
class_name: 'Orthogonal',
|
||
|
config: { gain: 1.0, seed: null }
|
||
|
},
|
||
|
bias_initializer: { class_name: 'Zeros', config: {} },
|
||
|
unit_forget_bias: true,
|
||
|
kernel_regularizer: null,
|
||
|
recurrent_regularizer: null,
|
||
|
bias_regularizer: null,
|
||
|
activity_regularizer: null,
|
||
|
kernel_constraint: null,
|
||
|
recurrent_constraint: null,
|
||
|
bias_constraint: null,
|
||
|
dropout: 0.0,
|
||
|
recurrent_dropout: 0.0,
|
||
|
implementation: 2
|
||
|
}
|
||
|
},
|
||
|
merge_mode: 'concat'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
class_name: 'Dense',
|
||
|
config: {
|
||
|
name: 'dense',
|
||
|
trainable: true,
|
||
|
dtype: 'float32',
|
||
|
units: 22,
|
||
|
activation: 'softmax',
|
||
|
use_bias: true,
|
||
|
kernel_initializer: {
|
||
|
class_name: 'GlorotUniform',
|
||
|
config: { seed: null }
|
||
|
},
|
||
|
bias_initializer: { class_name: 'Zeros', config: {} },
|
||
|
kernel_regularizer: null,
|
||
|
bias_regularizer: null,
|
||
|
activity_regularizer: null,
|
||
|
kernel_constraint: null,
|
||
|
bias_constraint: null
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
},
|
||
|
training_config: {
|
||
|
loss: null,
|
||
|
metrics: null,
|
||
|
weighted_metrics: null,
|
||
|
loss_weights: null,
|
||
|
optimizer_config: {
|
||
|
class_name: 'RMSprop',
|
||
|
config: {
|
||
|
name: 'RMSprop',
|
||
|
learning_rate: 0.001,
|
||
|
decay: 0.0,
|
||
|
rho: 0.9,
|
||
|
momentum: 0.0,
|
||
|
epsilon: 1e-7,
|
||
|
centered: false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
weightsManifest: [
|
||
|
{
|
||
|
paths: ['group1-shard1of1.bin'],
|
||
|
weights: [
|
||
|
{
|
||
|
name: 'bidi/forward_lstm/lstm_cell_4/kernel',
|
||
|
shape: [1200, 800],
|
||
|
dtype: 'float32'
|
||
|
},
|
||
|
{
|
||
|
name: 'bidi/forward_lstm/lstm_cell_4/recurrent_kernel',
|
||
|
shape: [200, 800],
|
||
|
dtype: 'float32'
|
||
|
},
|
||
|
{
|
||
|
name: 'bidi/forward_lstm/lstm_cell_4/bias',
|
||
|
shape: [800],
|
||
|
dtype: 'float32'
|
||
|
},
|
||
|
{
|
||
|
name: 'bidi/backward_lstm/lstm_cell_5/kernel',
|
||
|
shape: [1200, 800],
|
||
|
dtype: 'float32'
|
||
|
},
|
||
|
{
|
||
|
name: 'bidi/backward_lstm/lstm_cell_5/recurrent_kernel',
|
||
|
shape: [200, 800],
|
||
|
dtype: 'float32'
|
||
|
},
|
||
|
{
|
||
|
name: 'bidi/backward_lstm/lstm_cell_5/bias',
|
||
|
shape: [800],
|
||
|
dtype: 'float32'
|
||
|
},
|
||
|
{ name: 'conv2d/kernel', shape: [3, 3, 1, 40], dtype: 'float32' },
|
||
|
{ name: 'conv2d/bias', shape: [40], dtype: 'float32' },
|
||
|
{ name: 'conv2d_1/kernel', shape: [3, 3, 40, 60], dtype: 'float32' },
|
||
|
{ name: 'conv2d_1/bias', shape: [60], dtype: 'float32' },
|
||
|
{ name: 'dense/kernel', shape: [400, 22], dtype: 'float32' },
|
||
|
{ name: 'dense/bias', shape: [22], dtype: 'float32' }
|
||
|
]
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
// eslint-disable-next-line no-unused-vars
|
||
|
const charset = [
|
||
|
'',
|
||
|
'0',
|
||
|
'2',
|
||
|
'4',
|
||
|
'8',
|
||
|
'A',
|
||
|
'D',
|
||
|
'G',
|
||
|
'H',
|
||
|
'J',
|
||
|
'K',
|
||
|
'M',
|
||
|
'N',
|
||
|
'P',
|
||
|
'Q',
|
||
|
'R',
|
||
|
'S',
|
||
|
'T',
|
||
|
'V',
|
||
|
'W',
|
||
|
'X',
|
||
|
'Y'
|
||
|
]
|