Giter VIP home page Giter VIP logo

mann's People

Contributors

wzell 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

Watchers

 avatar  avatar  avatar  avatar  avatar

mann's Issues

Error running in Keras and TensorFlow with CORAL

Hello

After I modified mann_sentiment_analysis.py file for having the right version of Keras Visualization, the first neural network model ran but the CORAL failed with the exception below. Has anyone seen this? What is the fix? Thanks a lot for this nice package!!

Keras version - 2.1.5
TensorFlow version - 1.6.0

Exception

2018-09-03 18:35:33.550985: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
NN: 0.562929061785
Traceback (most recent call last):
File "sentiment_analysis.py", line 162, in
nn_coral.fit(x_s_tr, y_s_tr, x_t_tr, verbose=0, init_weights='nn')
File "/Users/udaykamath/mann/models/mann_sentiment_analysis.py", line 108, in fit
self.create()
File "/Users/udaykamath/mann/models/mann_sentiment_analysis.py", line 72, in create
encoded_s = encoding(input_s)
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 661, in call
regularization_losses = [self.activity_regularizer(x) for x in _to_list(output)]
File "/Users/udaykamath/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 661, in
regularization_losses = [self.activity_regularizer(x) for x in _to_list(output)]
File "/Users/udaykamath/mann/models/correlation_alignment.py", line 55, in call
raise Exception('Need to call set_layer on '
Exception: Need to call set_layer on ActivityRegularizer instance before calling the instance.

Sentiment analysis - val_pred_acc_1

Hello,

Thanks for sharing code for this project! I have question regarding implementation of sentiment analysis task (maybe I missed something). Why did you monitor 'val_loss' for EarlyStopping and then used 'val_pred_acc_1' for ModelCheckpoint?

If I understand well, 'val_loss' is related to source domain loss (validation data) while 'val_pred_acc_1' is related to accuracy of target data (validation part) during training. We don't have labels for target data (in code, they were set to zero), so I don't understand why is this value important for saving model. But, maybe I missed something :)

Hope to get your answer soon ! :)

Need to call `set_layer` on ActivityRegularizer instance before calling the instance

When I tried to run 'mann_sentiment_analysis.py', I encountered the following error:

Traceback (most recent call last):
File "sentiment_analysis.py", line 162, in
nn_coral.fit(x_s_tr, y_s_tr, x_t_tr, verbose=0, init_weights='nn')
File "/home/yanglu/Downloads/mann-master/models/mann_sentiment_analysis.py", line 108, in fit
self.create()
File "/home/yanglu/Downloads/mann-master/models/mann_sentiment_analysis.py", line 72, in create
encoded_s = encoding(input_s)
File "build/bdist.linux-x86_64/egg/keras/engine/topology.py", line 645, in call
File "/home/yanglu/Downloads/mann-master/models/correlation_alignment.py", line 55, in call
raise Exception('Need to call set_layer on '
Exception: Need to call set_layer on ActivityRegularizer instance before calling the instance.

It seems that the set_layer function hasn't been called by the Regularizer. My keras version if 2.1.2, I am wondering how could I fix this? Thanks!

Coral Problem

I would like to thank you so much for your great work!
I used my own data set and modified the structure of the network. I wanted to use the coral method and ran these codes in sentiment_analysis.py file.
image

Finally, I found that the effect before and after the coral was the same. I don’t understand the code mechanism in the coral. I don't think the coral mechanism is working, but don't know what's wrong
image
I try to print a sentence in the coral function, obviously this sentence is not executed at the end.
image

ValueError: negative dimensions are not allowed in object_recognition.py

All code are ok in PC, but when I run the following code its getting the error. Can you help me to fix it please? Keras version is 1.1.0.

(keras_python2) redhat@12:~/mann$ python object_recognition.py

Creating/Loading image representations via AlexNet model...
/home/redhat/keras_python2/local/lib/python2.7/site-packages/keras/backend/theano_backend.py:1282: UserWarning: DEPRECATION: the 'ds' parameter is not going to exist anymore as it is going to be replaced by the parameter 'ws'.
mode='max')
/home/redhat/keras_python2/local/lib/python2.7/site-packages/keras/backend/theano_backend.py:1282: UserWarning: DEPRECATION: the 'st' parameter is not going to exist anymore as it is going to be replaced by the parameter 'stride'.
mode='max')
/home/redhat/keras_python2/local/lib/python2.7/site-packages/keras/backend/theano_backend.py:1282: UserWarning: DEPRECATION: the 'padding' parameter is not going to exist anymore as it is going to be replaced by the parameter 'pad'.
mode='max')
Traceback (most recent call last):
File "object_recognition.py", line 81, in
'amazon', N_IMAGES_AM)
File "/home/redhat/mann/models/mann_object_recognition.py", line 186, in create_img_repr_alexnet
an = self.AlexNet(weights_file)
File "/home/redhat/mann/models/mann_object_recognition.py", line 448, in AlexNet
dense_1 = Dense(4096, activation='relu', name='dense_1')(dense_1)
File "/home/mahfuj/keras_python2/local/lib/python2.7/site-packages/keras/engine/topology.py", line 487, in call
self.build(input_shapes[0])
File "/home/redhat/keras_python2/local/lib/python2.7/site-packages/keras/layers/core.py", line 695, in build
name='{}_W'.format(self.name))
File "/home/redhat/keras_python2/local/lib/python2.7/site-packages/keras/initializations.py", line 59, in glorot_uniform
return uniform(shape, s, name=name)
File "/home/redhat/keras_python2/local/lib/python2.7/site-packages/keras/initializations.py", line 32, in uniform
return K.random_uniform_variable(shape, -scale, scale, name=name)
File "/home/redhat/keras_python2/local/lib/python2.7/site-packages/keras/backend/theano_backend.py", line 140, in random_uniform_variable
return variable(np.random.uniform(low=low, high=high, size=shape),
File "mtrand.pyx", line 1568, in mtrand.RandomState.uniform (numpy/random/mtrand/mtrand.c:16695)
File "mtrand.pyx", line 234, in mtrand.cont2_array_sc (numpy/random/mtrand/mtrand.c:3000)
ValueError: negative dimensions are not allowed

MMD

Hello
thank you for sharing this code, can we use MMD as a loss function using keras? sorry is there any code available to show how it is used as a loss function?

could you please let me know what is the impact of MMD for a shared layer in a joint network?

Best regards
Rebeen

CORAL Implementation

At first I would like to thank you so much for your great work.

In your code, there is a script named correlation_alignment.py . So if we want to get the result of CORAL method, what can we do?

If we just change
from models.correlation_alignment import CORALRegularizer

in object_recognition.py script, it would be ok? Please I am waiting your answer.

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.