-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contributing to Keras-Sharp #1
Comments
Hi @mdabros, Thanks for opening the issue. In my answer below I will re-write some of the points that I had mentioned in the TensorFlowSharp issue here, just to make it easier for others who will come to this issue later. The way I see, there are at least two almost separate lines of work that can be followed: The Keras engine, and the TensorFlowSharp backend.
In both cases, I would recommend doing just as you mention: open an issue here to signal you are going to work on the issue, then send a pull-request. If you are going to try to implement one of Keras examples, you can start by posting it in the issue tracker, so other people can realize what exactly you are trying to implement. Also, please note that the code is quite far from complete, and is not respecting the standard C#/.NET style in many places, especially regarding encapsulation. However, I think it would be better to ignore those style/encapsulation issues now in the beginning until we get most of the Python translation right. We will come back at them later. Regards, |
Hi guys. Thank you for great starting @cesarsouza! I feel this project is good to work on. And so, I want to work on TensorFlowSharp backends. And I have some opinion for developing roadmap. First, I want to make this project as portable class library based on Xamarin. Second, I am no idea to port python codes to c#, because I have no experience like that before. Does it line-by-line? I think line by line is the most convincing way as I think. |
@cesarsouza thanks for outlining the contribution procedure and plan of action. This will surely help to focus the effort. I like your approach for porting the Keras engine. I also think this is the fastest and safest way to get some examples up and running. I will try to help where ever it makes the most sense, with the goal of getting the examples to work. I should have a couple of days of spare time in the near future. I agree on functionality first and C# .Net style later. I really hope this will take-off in a good way :-). |
Hi @gmlwns2000, Thanks for the comment and willingness to help! I hadn't explicitly considered Xamarin in the roadmap of this project, but one thing that surely has been considered and will be implemented at some point is compliance to .NET Standard. Would a .NET Standard library be usable from Xamarin? If yes, then I guess Xamarin will be definitely supported. Regarding whether porting Python code on a line-by-line basis is possible, I would say it is quite feasible most of the time, even though sometimes we might have to get creative with LINQ. But most of the time it works (in the worst case, we can just write helper methods to accomplish the same effect as the python code. However, one thing that is surely difficult is to determine what is the most general type that a variable in Python is going to contain during runtime, so we can use the same type in C#. Another thing is to handle variables that change types, as it is common in Python when doing argument validation. However, those can be addressed by using some conventions (i.e. adopting a naming convention for variables that have already been validated inside a method, and whose type should not change anymore). @mdabros thanks, my main goal right now is to try to get as most people as possible interested in the project. I will not be able to commit much in the next 1-2 weeks because of a CVPR, but will surely retake the work later. In the meantime, please do not hesitate to spread the word about the project. Regards, |
Aloha, Just wanted to say that within the Xamarin team at Microsoft, we're very interested in AI and tools that can help democratize the technology. Personally I'm a big fan of Keras and am excited by this project, although there's clearly a lot of work ahead! If there is any help I can provide answering questions re. Xamarin technologies, Visual Studio for Mac, etc., please feel free to ask. |
Hi @lobrien, Thanks a lot for the positive feedback! However, as you correctly stated, there's lots of work ahead! Regarding Xamarin, as I might have mentioned before, though, I have to say that achieving Xamarin compatibility out-of-the-box is not a current target for the project. This is something that should come out naturally once all the foundation stones are laid out. Well, since you mentioned you could answer questions regarding Xamarin, actually I have one question to ask: I do not have much experience with Xamarin, but does it, or is it going to, offer support for .NET Standard 2.0 libraries out-of-the-box? If that's the case then I guess we will also have it covered because this should be certainly in the roadmap for this project. Regards, |
Hi everyone, I've just added some (crude) wiki page describing how one could contribute to the project by creating unit tests and making them pass. I've started working on making the very first example pass (Issue #3), but so far I have already committed working examples to the following TensorFlow backend functions:
If anybody would like to work in completing the TensorFlowSharp backends, please take a look at the wiki page I've just mentioned. Only a minimal knowledge of Python is necessary to complete those tasks. Regards, |
Hi everyone, The first example unit test (Issue #3) is now passing, meaning that the basic execution flow for adding layers to a Sequential model should now be working. I am now adding more unit tests for other examples in the documentation. By the way, if anybody who is willing to contribute would like some tips on how to port Python code from Keras, I just wanted to say that it is possible to install Keras (from git), TensorFlow (using pip3) and Spyder3 (from apt-get) in Bash for Windows 10. Afterwards, if you have a X server/client also installed such as VcXsrv you will be able to launch Spyder3 and follow Keras' Python examples using a debugger, to see if the execution is indeed following the same code path. Regards, |
Hi everyone, Just to give an update: the basic layers, loss functions, weight initializers have already been implemented in Keras Sharp. However, before we are able to get a model to train, it might be necessary to solve migueldeicaza/TensorFlowSharp#25 first. If anyone would like to help solving that issue in TensorFlowSharp repository, please feel free to jump in! Regards, |
Currently blocked by tensorflow/tensorflow#13190 |
Until the TensorFlow/TensorFlowSharp issues are fixed, I've started adding support for CNTK instead. |
- Continuing to add support for training; - Adding more CNTK backend implementations; - Updates #1: Contributing to Keras-Sharp;
Hi everyone! I just wanted to let you know that Keras# finally supports model training. There are a few issues (particular to TensorFlowSharp, CNTK, and even both) which are currently preventing more complex models from being trained right at this moment. However, since the main engine and most of the backend code for both CNTK and TensorFlow has already been ported, the project now allows users to train and evaluate MLPs - while it's certain that MLPs are no big deal for most machine learning frameworks right now, the main point is that those MLPs are being trained by a direct, line-by-line port of the Python Keras API into C#. This means we are currently supporting console status output, configurable metrics and switchable backends (for both CNTK and TensorFlow). Even though only MLPs are supported for now, this update should serve as a validation that the main idea, i.e. bringing a line-by-line port of Keras to C#, is not only feasible, but it's one of the most extensibility-friendly routes that could have been adopted for development. Until a few days ago support for CNTK had barely been planned, but thanks to the knowledge laying in Keras-proven APIs, it could be added in almost no time. If anyone is interested - please subscribe to (watch) the project's issue tracker for new issues. I will be adding new issues shortly describing areas that need further development, in order of priority. Regards, |
Hello, |
Hi @lydiae36, Thanks a lot for the comment! There is a page detailing how to contribute to the project in the wiki. I've just updated it to include also instructions about how to clone and build the project for the first time. Hope it helps! If you find a problem following the instructions please let me know so I can update it! Regards, |
Hi @cesarsouza Development environment has been successfully created. In addition, |
Hi @lydiae36, Great! I am glad it has worked for you. Regarding the "load_model" function I am afraid it will take a bit more of time. Many operations are still not available in TensorFlow's C++ API and TensorFlowSharp yet (meaning they are a bit outside of my control at the moment). However, if you could let me know which kind of model you are trying to implement, and if could provide me an example of the particular HDF5 file that you are trying to load into Keras#, I could start to shift development towards this goal and give more priority to this issue. Regards, |
@cesarsouza Great work starting keras-sharp. I will have a more in depth look at the code as soon as time permits and start contributing.
You have already mentioned a lot of todos and a plan of action in the [keras-sharp-thread-in-tensorflowsharp]migueldeicaza/TensorFlowSharp#75.
What is the procedure for contributing so several people don't start working on the same issue. Create an issue based on the todo list and create a corresponding pull request?
The text was updated successfully, but these errors were encountered: