ameybarapatre / waveletneuralnetwork Goto Github PK
View Code? Open in Web Editor NEWWavelet Neural Network implementation in Theano
License: MIT License
Wavelet Neural Network implementation in Theano
License: MIT License
What is the license of this code? Also could a license file be added please? Thanks.
epoch 827, minibatch 12/12, validation error 66.657396 %
epoch 827, minibatch 12/12, test error of best model 66.666712 %
epoch 828, minibatch 12/12, validation error 66.657394 %
epoch 828, minibatch 12/12, test error of best model 66.666711 %
epoch 829, minibatch 12/12, validation error 66.657392 %
epoch 829, minibatch 12/12, test error of best model 66.666711 %
epoch 830, minibatch 12/12, validation error 66.657390 %
epoch 830, minibatch 12/12, test error of best model 66.666711 %
epoch 831, minibatch 12/12, validation error 66.657388 %
epoch 831, minibatch 12/12, test error of best model 66.666711 %
epoch 832, minibatch 12/12, validation error 66.657386 %
epoch 832, minibatch 12/12, test error of best model 66.666711 %
epoch 833, minibatch 12/12, validation error 66.657384 %
epoch 833, minibatch 12/12, test error of best model 66.666710 %
Optimization complete. Best validation score of 66.657384 % obtained at iteration 9996, with test performance 66.666710 %
0.66666710415
The code for file file ran for 0.03m
I did one hot encoding for Iris data set.
datasets = pd.read_csv(dataset,sep=',',header=None). training
ValueError Traceback (most recent call last)
in ()
460
461 if name == 'main':
--> 462 test_mlp()
in test_mlp(learning_rate, L1_reg, L2_reg, n_epochs, dataset, batch_size, n_hidden)
403 for minibatch_index in range(n_train_batches):
404
--> 405 minibatch_avg_cost = train_model(minibatch_index)
406 # iteration number
407 iter = (epoch - 1) * n_train_batches + minibatch_index
/home/coea/anaconda2/lib/python2.7/site-packages/theano/compile/function_module.pyc in call(self, *args, **kwargs)
869 node=self.fn.nodes[self.fn.position_of_error],
870 thunk=thunk,
--> 871 storage_map=getattr(self.fn, 'storage_map', None))
872 else:
873 # old-style linkers raise their own exceptions
/home/coea/anaconda2/lib/python2.7/site-packages/theano/gof/link.pyc in raise_with_op(node, thunk, exc_info, storage_map)
312 # extra long error message in that case.
313 pass
--> 314 reraise(exc_type, exc_value, exc_trace)
315
316
/home/coea/anaconda2/lib/python2.7/site-packages/theano/compile/function_module.pyc in call(self, *args, **kwargs)
857 t0_fn = time.time()
858 try:
--> 859 outputs = self.fn()
860 except Exception:
861 if hasattr(self.fn, 'position_of_error'):
ValueError: Input dimension mis-match. (input[0].shape[2] = 19, input[1].shape[2] = 18)
Apply node that caused the error: Elemwise{sub,no_inplace}(InplaceDimShuffle{0,x,1}.0, InplaceDimShuffle{x,0,1}.0)
Toposort index: 30
Inputs types: [TensorType(float64, (False, True, False)), TensorType(float64, (True, False, False))]
Inputs shapes: [(10, 1, 19), (1, 18, 18)]
Inputs strides: [(8, 41344, 2176), (2592, 144, 8)]
Inputs values: ['not shown', 'not shown']
Outputs clients: [[Elemwise{Composite{EQ(((i0 * i1 * i2) / i3), i4)}}(TensorConstant{(1, 1, 1) of 0.5}, Elemwise{sub,no_inplace}.0, Elemwise{Composite{exp((i0 * sqr(i1)))}}.0, InplaceDimShuffle{x,0,1}.0, TensorConstant{(1, 1, 1) of 0.0}), Elemwise{true_div,no_inplace}(Elemwise{sub,no_inplace}.0, InplaceDimShuffle{x,0,1}.0), Elemwise{Composite{((i0 * i1 * i2 * i3 * i4) / i5)}}(TensorConstant{(1, 1, 1) of 0.5}, Elemwise{eq,no_inplace}.0, Elemwise{neq,no_inplace}.0, Elemwise{sub,no_inplace}.0, Elemwise{Composite{exp((i0 * sqr(i1)))}}.0, InplaceDimShuffle{x,0,1}.0), Elemwise{Composite{Switch(i0, ((i1 * i2 * i3 * i4) / (i5 * i6)), Switch((i7 * i8), i9, i10))}}(Elemwise{eq,no_inplace}.0, TensorConstant{(1, 1, 1) of 2.0}, InplaceDimShuffle{0,1,x}.0, InplaceDimShuffle{0,1,x}.0, InplaceDimShuffle{x,0,1}.0, Elemwise{sub,no_inplace}.0, Elemwise{Composite{exp((i0 * sqr(i1)))}}.0, Elemwise{eq,no_inplace}.0, Elemwise{Composite{EQ(((i0 * i1 * i2) / i3), i4)}}.0, Elemwise{Mul}[(0, 1)].0, TensorConstant{(1, 1, 1) of 0}), Elemwise{Composite{((-((i0 * i1 * i2 * i3) + ((i4 * i1 * i3 * i2 * i5 * i3) / i6))) / i7)}}[(0, 1)](TensorConstant{(1, 1, 1) of 0.5}, Elemwise{Composite{Switch(i0, ((i1 * i2 * i3 * i4) / (i5 * i6)), Switch((i7 * i8), i9, i10))}}.0, Elemwise{Composite{exp((i0 * sqr(i1)))}}.0, Elemwise{sub,no_inplace}.0, TensorConstant{(1, 1, 1) of -0.5}, Elemwise{true_div,no_inplace}.0, InplaceDimShuffle{x,0,1}.0, Elemwise{sqr,no_inplace}.0), Elemwise{Composite{(((i0 * i1 * i2) / i3) + ((i4 * i1 * i5 * i2 * i6) / i7))}}(TensorConstant{(1, 1, 1) of 0.5}, Elemwise{Composite{Switch(i0, ((i1 * i2 * i3 * i4) / (i5 * i6)), Switch((i7 * i8), i9, i10))}}.0, Elemwise{Composite{exp((i0 * sqr(i1)))}}.0, InplaceDimShuffle{x,0,1}.0, TensorConstant{(1, 1, 1) of -0.5}, Elemwise{sub,no_inplace}.0, Elemwise{true_div,no_inplace}.0, Elemwise{sqr,no_inplace}.0)]]
Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "/home/coea/anaconda2/lib/python2.7/site-packages/ipykernel/zmqshell.py", line 501, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "/home/coea/anaconda2/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2717, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "/home/coea/anaconda2/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2821, in run_ast_nodes
if self.run_code(code, result):
File "/home/coea/anaconda2/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 462, in
test_mlp()
File "", line 311, in test_mlp
n_out=1
File "", line 205, in init
n_out=n_hidden,
File "", line 154, in init
x =(self.input - self.A)/self.B
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.
Hello can you provide some information on how to use this with Theano or even Keras library?
I want to use wavelet neural networks for a project i work on and this might be useful. One the other hand maybe you can provide links to other libraries.
Thank you,
Nikos
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.