Giter VIP home page Giter VIP logo

neural-disaggregator's People

Contributors

christofernal avatar maechler avatar odysseaskr avatar psalias2006 avatar spatzi 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

neural-disaggregator's Issues

Training Multiple Buildings: Window GRU with REDD dataset

Hello!
I am attempting to use your implementation of the WindowGRU algorithm to train across multiple houses.
The following is how the code is structured,
Screen Shot 2019-08-08 at 5 00 25 PM
Screen Shot 2019-08-08 at 5 00 46 PM
Screen Shot 2019-08-08 at 5 00 57 PM

I am having issues with the test section and the disaggregate method, and am not sure how to proceed.
I am working on python 3.7 on Mac OS X.

Thank you!

Question:sample-period

Hello:
I‘m confused about the sample_period, I set sample_period=1 for the dish washer but get bad results, the predict result can hardly match the actual data.May I ask about the sample_period for dish washer and microwave and how you choose the value of them.Thanks a lot!

`pydot` failed to call GraphViz

when i run the command:
dae = DAEDisaggregator(256)
i get the error:
OSError: pydot failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH
but i already have pydot and graphviz installed. please help, thanks in advance!

Getting a TypeError while calling the function "metrics.recall_precision_accuracy_f1(predicted, ground_truth)"

@OdysseasKr @ChristoferNal @Spatzi

I am trying to execute your code ukdale-test.py. I also tried to execute ipynb file "RNN-example.ipynb". All went well but when I try to call the function "metrics.recall_precision_accuracy_f1(predicted, ground_truth)" to check the performance of the model, it gives me type error like this: " TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Index'
". I am unable to resolve this error. Something is wrong with "predicted" file (which holds the data of building-2 [dish washer]that was generated after testing the model in HDF5 format.

Please help me out in this matter.

Uploading SS2.jpg…

installation

hello !
i don't know how to install the requirements !
PS : I already have a working nilmtk environment
help

Wrong call for the f1 score?

in DAE-example.ipynb the F1 score should be called with rpaf[3]? It should be .45701927 for the example given.

import metrics
rpaf = metrics.recall_precision_accuracy_f1(predicted, ground_truth)
print("============ Recall: {}".format(rpaf[0]))
print("============ Precision: {}".format(rpaf[1]))
print("============ Accuracy: {}".format(rpaf[2]))
print("============ F1 Score: {}".format(rpaf[2]))

print("============ Relative error in total energy: {}".format(metrics.relative_error_total_energy(predicted, ground_truth)))
print("============ Mean absolute error(in Watts): {}".format(metrics.mean_absolute_error(predicted, ground_truth)))

question about train_elec.mains() for ukdale

Hi, Sir
Thanks for your help.
I am so confused for the following,

input(for ukdale):
train_meter = train_elec.submeters()['kettle']
train_mains = train_elec.mains()

output:
ElecMeter(instance=54, building=1, dataset='UK-DALE', site_meter, appliances=[Appliance(type='immersion heater', instance=1), Appliance(type='water pump', instance=1), Appliance(type='security alarm', instance=1), Appliance(type='fan', instance=2), Appliance(type='drill', instance=1), Appliance(type='laptop computer', instance=2)])
)

What is the meaning for this elecmeter ? is it site_meter for all application in this building ? but why there are part of application likes water pump, security alarm etc in the same ElecMeter.

Thanks,

prediction of the whole appliances

Hi,
I found your project very interesting. Just a quick question.Is it possible to train and test the whole number of appliances (not only a single one)?. If it is possible, which command is used for doing and plot "ground_truth" and all the predicted appliances together?
Thank you in advance
Cheers

Attribute error

Thanks for your work, but I have a question about it.
in case of redd dataset there are two meters in site meter so only one meter of site meter is loaded to dis aggregate as like this
train_mains = train_elec.mains().all_meters()[0]

but i use synd dataset for this i have only one meter so i modified this as
train_mains = train_elec.mains()
with this code i got the Attribute error. as shown below
Screenshot from 2021-07-09 10-42-20

could you please suggest me the solution

Thanking you

Metrics (precision, recall, F1-Score)

Hello Odyssea,

When I run the GRUWithWindow code (python3 experiment.py kettle) from the https://github.com/OdysseasKr/online-nilm repository, I get the following numbers for metrics after training the class kettle for 4 houses and testing in the last house.

Epoch 00001: saving model to experiments/kettle/CHECKPOINT-kettle-1epochs.hdf5
Epoch 2/3
800000/800000 [==============================] - 722s 902us/step - loss: 0.0039

Epoch 00002: saving model to experiments/kettle/CHECKPOINT-kettle-2epochs.hdf5
Epoch 3/3
800000/800000 [==============================] - 698s 873us/step - loss: 0.0039

Epoch 00003: saving model to experiments/kettle/CHECKPOINT-kettle-3epochs.hdf5
/home/anasvaf/Desktop/MultiLabel_Energy/GRUWithWindow/metrics.py:40: RuntimeWarning: invalid value encountered in true_divide
  return tp/float(tp+fp)
============ Recall: 0.0
============ Precision: nan
============ Accuracy: 0.9962941517081645
============ F1 Score: nan
============ Relative error in total energy: 0.012862401778851902
============ Mean absolute error(in Watts): 21.46095589801764

I can confirm also the same exact numbers when I run the RNN code using the https://github.com/OdysseasKr/neural-disaggregator repository.

I am using Python 3.5 and the following library versions:
numpy: 1.15.2
matplotlib: 3.0.0
pandas: 0.23.4
pytables: 3.4.4
nilmtk: 0.2
keras: 2.2.4

Could you help me with that?

Thanks in advance!

-Tasos

Why just load mains from only one meter of site_meter?

Thanks for your awesome work, but I have a question about it. It looks like you just load
only one meter of site meter, as shown in your code:
train_mains = train_elec.mains().all_meters()[0] # The aggregated meter that provides the input

but there are two meters for recording site meter.
The aggregate powers summed together by elec.mains().power_series_all_data().

Calling diaggregate with a single monthly aggregate reading.

This is probably more of an NILMTK question, but the disaggregate function in the shortseq2pointdisaggregator.py takes an Elecmeter object as a parameter. However, I am interested in getting the disaggregation of a single monthly aggregate. I tried to circumvent this by using something similar to the dataset converter code, by writing and reading from a hdf5 store, but I didn't manage to get anywhere with it. Is there any other way to achieve this?

failed to import pydot

When I run rnn = RNNDisaggregator() , I get the error: ImportError: Failed to import pydot. Please install pydot. For example with pip install pydot. Pydot is already installed in my python.

train_across_buildings and train_across_buildings_chunk

Hi, first of all, thank you for your work. I have a question that I do n’t quite understand. I hope to get your answers. What is the use of 'train_across_buildings_chunk'? I do n’t know what this training is different from the previous 'train on chunk' It seems that 'train_across_buildings_chunk' is not used in the program. What is the purpose of this code?

Add requirements

Hello, can you give a detailed environment configuration? Specifically, it's about the version of tensorflow, and other Python wheel versions, because I always make mistakes when running these sources. I will be grateful.

OSError

I get this pydot and graphviz issue on my windows conda environment.

OSError: pydot failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.

Question about model used in RNN

Hi, I have some question as described as following,
image

after 1D Conv, the shape change from (1,1) to (1,16), is that means that each input value changed to (1,16)?
besides, Could you please give me more detail about how the first LSTM work? ex: How many step numbers here etc.

I am so confused, Thanks!

Metrics call to align_two_meters parameter order

Hi,
I've been playing around with your code according to your IPython Notebooks and came across an error when calling the metrics function. Down the line, this function calls nlimtks goodsections.py function _process_chunk (https://github.com/nilmtk/nilmtk/blob/412be54eefd81ae78d0f1ed3053bf8977063e61d/nilmtk/stats/goodsections.py#L36) which expects a DataFrame with parameter timeframe, which did not exist and therefore threw an error.

While trying to fix my error, I came across the documentation of align_two_meters which says it would take the timeframe from meter 'master', which is the first argument of that function. In your call you provide the function with (pred, ground), which seems off to me. After changing the order to (ground, pred) I no longer encountered the problem.

Can you assure me, that the order of your arguments is indeed correct?

This is the section I'm referencing, but the call is them same for all metrics files:

aligned_meters = align_two_meters(pred, ground)

Loading Model

Hello everybody ,
thank you OdysseasKr for the great work
i have tried the Recurrent network with LSTM , i have trained the model then exported it and it's working very well.
but i have an enquiry , after loading the model and when we use the method disaggregate of ### RNNDisaggregator() , why we need the aggregated meter that provides the input (train_meter) for disaggregation ? i'm confused

How did you ues NILMTK

Hi,there! I'm wondering how to get activations like the paper you sited in the "ReadME.txt", I download your code but I can't find where did you use NILMTK to get activations of the target electrical equipment. Hope to get an answer of how to use NILMTK to solve this problem.
Meanwhile, the title of your project is neural-disaggregator, but the coda is for predicting. I'm wondering the contact between them.
Thx for your answering!

Window sizes and quality of results

In the Neural NILM paper it says
https://arxiv.org/pdf/1507.06594.pdf

The
window width is decided on an appliance-by-appliance basis
and varies from 128 samples (13 minutes) for the kettle to
1536 samples (2.5 hours) for the dish washer

Where in your code can I find the window width ? Or if you could point me to the code where we can play with window width

Export and import model

Hello Odyssea,
when applying the method export_model after training my model:

disaggregator.export_model("model-redd5.h5")

I try to import this model by doing :

cls = disaggregator.import_model("model-redd5.h5")
predictions = cls.disaggregate_chunk(A_batch)

but by doing that, it returns that cls has no method disaggregate_chunk. To predict test values, i have to train every time my model. So how can i use the method import_model for the disaggregation, without doing the training every time I need to predict test values.

Thanks

Question: Basic Parameters

Hello,

I am confused with Batch Size and Window Size. Can you please explain with an example along with how do choose these numbers?

The result data is not correct

hi, i have run RNN-example.ipynb,but the data is not correct.
my result is
============ Recall: 0.06080812748658777
============ Precision: 0.7873688147161255
============ Accuracy: 0.29049305213046556
============ F1 Score: 0.11289725264136873
============ Relative error in total energy: 0.7858544224150322
============ Mean absolute error(in Watts): 19.859596349905722

but your result is
============ Recall: 0.997835349341
============ Precision: 0.742378777703
============ Accuracy: 0.741308963402
============ F1 Score: 0.851357054837
============ Relative error in total energy: 0.871686427835
============ Mean absolute error(in Watts): 32.2338755931

I don't know what I did wrong.I ran it all according to your code.

Training multiple buildings

Hello Odyssea,

I am trying to replicate the results based on the Kelly et al. paper.
Using your code I changed the train building to the following:

train.set_window(start="13-4-2013", end="1-1-2014")
test.set_window(start="1-1-2014", end="30-3-2014")

train_elec = []
test_building = 5
sample_period = 6
meter_key = 'kettle'

# Lists for train_elec, train_meter and train_mains for multiple buildings
train_elec = [train.buildings[i].elec for i in range(1,5)]
train_meter = [train_elec[j].submeters()[meter_key] for j in range(len(train_elec))]
train_mains = [train_elec[k].mains() for k in range(len(train_elec))]

# Test only in one house
test_elec = test.buildings[test_building].elec
test_mains = test_elec.mains()
rnn = RNNLSTMDissaggregate()

and then I call the train_across_buildings

start = time.time()
print("========== TRAIN ============")
epochs = 0
for i in range(3):
    print("CHECKPOINT {}".format(epochs))
    rnn.train_across_buildings(train_mains, train_meter, epochs=5, sample_period=sample_period)
    epochs += 5
    rnn.export_model("UKDALE-RNN-h{}-{}-{}epochs.h5".format(train_building,
                                                        meter_key,

I am creating lists for the 4 houses that I need during the training but I get the following error when I run the RNN for the function "train_across_buildings"

test

Could you give me some hint on how to change the code?

Best,
Tasos

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.