-
We have a pre-trained network and want to perform transfer learning using it.
-
Lets say we keep initial 5 layers from the pre-trained network and add our own layers on top of it.
-
Output of layer number 5 was given the name "layer5_out" when building the network
-
We can perform transfer learning on this in 2 ways:
1. Initialize the first 5 layers using the weights of the pre-trained network and freeze them during training. 2. Initialize the first 5 layers using the weights of the pre-trained network and train them i.e. update them during training.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FragmentA extends Fragment{ | |
OnFragmentInteractionListener listener; | |
@Override | |
public void onAttach(Activity activity) { | |
super.onAttach(activity); | |
try { | |
listener = (OnFragmentInteractionListener) activity; | |
} catch (ClassCastException e) { | |
throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FragmentManager fragmentManager = getFragmentManager(); | |
FragmentA fragmentA = (FragmentA) fragmentManager.findFragmentByTag(FragmentA.TAG); | |
if(fragmentA != null && fragmentA.isAdded()){ | |
fragmentA.foo() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AddToCartEvent{ | |
private Product product; | |
public AddToCartEvent(Product product){ | |
this.product = product; | |
} | |
public Product getProduct(){ | |
return product; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onCreate(Bundle savedInstanceState){ | |
super.onCreate(savedInstanceState); | |
//register with the event bus | |
EventBus.getDefault().register(this); | |
// other code goes here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyDatabaseHelper{ | |
public MyDatabaseHelper(){ | |
EventBus.getDefault().register(this); | |
} | |
// To register an async event handler you need to define onEventAsync or onEventBackgroundThread | |
// Here we will use onEventBackgroundThread, please check EventBus' docs for more details. | |
public void onEventBackgroundThread(AddToCartEvent event){ | |
Product product = event.getProduct(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EventBus.getDefault().post(new AddToCartEvent(productObject)); |
To remove a submodule you need to:
# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule
# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule
# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule