Giter Site home page Giter Site logo

packtpublishing / deep-learning-with-keras Goto Github PK

View Code? Open in Web Editor NEW
1.1K 104.0 716.0 1.69 MB

Code repository for Deep Learning with Keras published by Packt

License: MIT License

Python 4.18% Jupyter Notebook 95.63% Shell 0.03% Dockerfile 0.08% Makefile 0.08%

deep-learning-with-keras's People

Contributors

adityakpackt avatar dadebarr avatar packt-itservice avatar packtutkarshr avatar snowmasaya avatar vishalmewadapackt avatar zuoshifan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deep-learning-with-keras's Issues

Semi-supervised learning GANs for classification

Hello,

I have been reading the book to try to understand the GANS. I would like to try it (GANs) for classification.

I have been looking to this code :https://github.com/PacktPublishing/Deep-Learning-with-Keras/blob/master/Chapter04/example_gan_convolutional.py

To try to adapt it to a GAN with N+1 outputs being N the number of classes and +1 for the forge output.
Some things I dont understand on the example, like the output generation gan_targets(xtest.shape[0]). ... How exactly can the GAN architecture test if the output is fake or not ?

And to adapt this example, to make a Semi-supervised learning for classification, how should we incorporate the output layer of 10 with soft max and construct the outputs align with the inputs (and generated -fake- inputs with label ) ?

I would be grateful if there was some example, based on this one, were we could see GANs performing classification ?

Thanks in advance,
Rui

Dropout layer error in transfer_glove_embeddings.py

Hi all!

I am trying to replicate the model of transfer_glove_embeddings.py. When I try to execute the model I gel the following error:

`---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
8 weights=[embedding_weights],
9 trainable=True))
---> 10 model.add(SpatialDropout1D(Dropout(0.2)))
11 model.add(Conv1D(filters=NUM_FILTERS, kernel_size=NUM_WORDS,
12 activation="relu"))

~/.virtualenvs/negative-scoring/lib/python3.6/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

~/.virtualenvs/negative-scoring/lib/python3.6/site-packages/keras/layers/core.py in init(self, rate, **kwargs)
162 @interfaces.legacy_spatialdropout1d_support
163 def init(self, rate, **kwargs):
--> 164 super(SpatialDropout1D, self).init(rate, **kwargs)
165 self.input_spec = InputSpec(ndim=3)
166

~/.virtualenvs/negative-scoring/lib/python3.6/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

~/.virtualenvs/negative-scoring/lib/python3.6/site-packages/keras/layers/core.py in init(self, rate, noise_shape, seed, **kwargs)
99 def init(self, rate, noise_shape=None, seed=None, **kwargs):
100 super(Dropout, self).init(**kwargs)
--> 101 self.rate = min(1., max(0., rate))
102 self.noise_shape = noise_shape
103 self.seed = seed

TypeError: '>' not supported between instances of 'Dropout' and 'float'`

Any ideas? thanks in advanced

TypeError: a bytes-like object is required, not 'str'

ipython-input-11-cde6afe50c78 in module()
5 ftrain=open(os.path.join(Data_dir,"training.txt"),'rb')
6 for line in ftrain:
----> 7 label, sentence = line.strip().split("\t")
8 words=nltk.word_tokenize(sentence.decode().lower())
9 if len(words)>maxlen:

I am using Python3.6

2.2.5 Key Attributes Page 33

It seems there is an error on line which start with

So what we have here is a 3D tensor of 8-bit integers. More precisely, it's an array of 60,000 matrices of 28 x 8 integers.

This should be 28 X 28 integrers.

leNet not work with keras 2.3.1

Chapter03/keras_LeNet.py
line 58: AttributeError: module 'keras.backend' has no attribute 'set_image_dim_ordering'
line 28: ValueError: Negative dimension size caused by subtracting 2 from 1 for 'max_pooling2d_1/MaxPool' (op: 'MaxPool') with input shapes: [?,
1,28,20].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.