I am about to submit a paper in which one of the algorithms I used is heavily based on the code available on one of the TensowFlow tutorials. In fact, I mostly copied the code from the page and made the necessary modifications for my specific case. I did cite, in the paper, both TensorFlow and the page, and disclosed that the neural net architecture I was using was based on the one on the page. The licensing terms of the code (Apache 2.0) mention that the user is free to build upon the code and redistribute it.

I am not in CS, and am applying the model to a specific problem in my field. However, in copying the code (which I believe will not be disclosed) I am afraid I might be doing academic misconduct. However, on the other hand, if that was the case, using open-source libraries would also be frowned upon, given that the user is essentially copying code.

Will I be committing academic misconduct or anything that is ethically frowned upon in academia by submitting results parts of which were based on copied code?

PS: In response to a comment, I cited TensorFlow and the webpage in the paper, which will be published if accepted, but the code itself (which was heavily based on the code available in the webpage) won't be posted anywhere (as far as I know).

  • 2
    I'm confused. In the first paragraph, you say you cited the page but I the second paragraph you say the copy will not be disclosed. Those seem mutually exclusive to me. Could you elaborate? Commented Dec 9, 2017 at 16:44

2 Answers 2


You are doing the right thing as long as you clearly cite your sources. In other words, as long as you say that your code is based on someone else's code, and as long as you clearly cite what that "someone else's code" is and where a reader can find it, you are ok.

The fact that the basis for your work is open source does not require you to share your code as well (though that would clearly be in the spirit of open source software). Open source software generally just means that if you give someone else an executable of your implementation using an open source package, that you also need to give them the source code of your implementation. (The details vary based on the license in question, but that's the idea.) As long as you write the code only for yourself, there is no need or requirement to share it with others.

  • 1
    I would recommend very strongly to make your own code open source. It makes your "experimentation" reproducible. IMNSHO every software funded by public research money should be open source. Commented Dec 9, 2017 at 17:53
  • Note that journals or the terms of your grant may require you to share your code. Plus it is good practice to do so. It can't be too horrible to show other people if you copied most of it from a third party anyway.
    – OganM
    Commented Dec 12, 2017 at 2:47

If you include other people's work in your paper, you need to reference it.

"Other people's work" includes - but is not exclusive to - the following :

  • words you're quoting from a lecture, a conversation or other oral context
  • words you're quoting from a paper, book or other publication
  • photographs that you include from a paper, book or other source
  • graphs that you include from a paper, book or other source
  • source code that you include from a paper, book, Github page or other source

The Apache 2.0 license allows you to legally build upon the code and redistribute it in pretty much any context. Just attribute any borrowed code to the original author(s) either in the comments of your code or as a normal source reference and you should be fine.

Remember that we're all standing on the shoulders of giants. There's nothing wrong with borrowing other people's code if that code is properly licensed (as it is in your case). Just don't pretend it's your own and you'll be fine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .