tiagocuervo / tensoranfis Goto Github PK
View Code? Open in Web Editor NEWA Tensorflow implementation of the Adaptive Neuro-Based Fuzzy Inference System (ANFIS)
License: MIT License
A Tensorflow implementation of the Adaptive Neuro-Based Fuzzy Inference System (ANFIS)
License: MIT License
Hello can you please help me in using tensor flow ANFIS for multiple output. i have 7 inputs and 5 outputs. I have to predict these 5 output in one model using ANFIS. Any help in this is regard is highly appreciated.
Hi,
I'm trying to adapt your code to my data but i think i am missing something.
Even with simple data like :
inputs : [1, 2, 3, 4], [5, 6, 7, 8]
output : [100], [200]
The results are really bad. I saw that data had to be standardized, but what is the rule? Can you give me an example?
Attached used files.
Thank you in advance.
Greetings,
I've adapted your code for my simple two-dimensional data set. According to statement below, since the TensorFlow doesn't support the attribute 'placeholder':
AttributeError: module 'tensorflow' has no attribute 'placeholder'
I had to consider disabling v2 behavior via replacing the term import tensorflow as tf with:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
Although it apparently looks compatible, the 'mu' parameter reuse tends to be problematic. Inciting the error below:
Variable mu already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope?
Thus, I've tried to solve this by tf.variable_scope("anfis", reuse=tf.AUTO_REUSE) which didn't work either!!!
Kindly assist me through a feasible solution if you had any ideas.
Yours sincerely
Hello, can you help me how to train ANFIS using hybrid GA-SA algorithm?
Appreciated!
I used your code with the sample data having 2 inputs and 1 output(target value) to predict... training ran and it converges as below.
Log:
Train cost after epoch 0: 256.180145
Train cost after epoch 100: 255.096405
Train cost after epoch 200: 254.066574
Train cost after epoch 300: 253.050385
Train cost after epoch 400: 252.039536
Train cost after epoch 500: 251.031601
Train cost after epoch 600: 250.025452
Train cost after epoch 700: 249.020569
Train cost after epoch 800: 248.016602
Train cost after epoch 900: 247.013275
Elapsed time: 1.634994
Validation loss: 532.910950
Model saved in path: /content/model.ckpt
Elapsed time: 1.634994
Elapsed total script execution time: 7.826581
The output of training is as attached as above.
But after this, when I check with the val_pred, it results in the following same values for all the data...!!!
[10.303363 10.303363 10.303364 10.303363 10.303363 10.303363 10.303363]
But the actual value which I gave for the chkLbls is as follows
[437.4 575.5 407.6 682. 475.3 581.3 646.9]
why it is having all values same?? is it correct to have the same value in val_pred after training?
If so, after training, I just saved the tf.session using the following code
save_path = saver.save(sess, "/content/model.ckpt") print("Model saved in path: %s" % save_path)
After saving the model, how can I use it to predict the model using random values of input?? so that I can check whether the model works fine with varied input??
Hi! Perhaps there is a version with a real time set at the input? Evgeniy
Where is the Consequent Parameter from the rule?
Is there no Least Square Estimator in this step?
Is it possible to save the model? What library/function can we use to do so?
I have tried all the following, just after plotting the results, and all give me some kind of error...
...
# Plot resulting membership functions
fis.plotmfs(sess)
plt.show()
#joblib.dump(fis, "./Models/anfisModel")
#tf.keras.models.save_model(fis, "./Models/anfisModel")
#fis.save("./Models/anfisModel")
#import pickle
#pickle.dump(fis, open("./Models/anfisModel", 'wb'))
tf.saved_model.save(fis, "./Models/anfisModel")
The last one, for example, returns with the following error:
ValueError: Expected a Trackable object for export, got <anfis.ANFIS object at 0x7f592a99daf0>.
All the others return similar errors like "fis has no save atribute" and so on.
I guess it is because it is not a tensorflow object, but a custom one you create using tf?
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.