- It pays to think creatively. Specifically, can something be modelled as an image that can be fed into a neural network for training?
- Create a Python
PoxisPathfrom a filename via the prefixpath/. - Each data set should comprise a training set and a validation set. The validation loss should usually be slightly higher than the training loss.
- The fastai library supports loading data sets into ImageDataBunch's from DataFrames (
from_df), CSVs (from_csv), file name regex (from_name_re), file name functions (from_name_func), from folder names (from_folder), and from Python lists (from_lists). ImageDataBunch.classescan generally be thought of as the number of labels.ImageDataBunch.show_batchgives us a quick look at the data. This is useful to get a feel of the data before training the model.
This file contains hidden or 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
| #include <nmmintrin.h> | |
| #include <string.h> | |
| #define HAVE_SSE4_2 | |
| static const char ___m128i_shift_right[31] = | |
| { | |
| 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, | |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 | |
| }; |
This file contains hidden or 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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| #define s32 int32_t | |
| #define s64 int64_t | |
| #define u32 uint32_t | |
| #define u64 uint64_t | |
| #define f32 float | |
| #define f64 double | |
| #define vi vector<s32> |
This file contains hidden or 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
| class IntroductionActivityTest { | |
| @Before | |
| public void setUp() { | |
| Intents.init(); | |
| } | |
| @After | |
| public void tearDown() { | |
| Intents.release(); | |
| } |
This file contains hidden or 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
| class IntroductionActivityTest { | |
| // Rest of the class | |
| @Test | |
| public void onClickButton_showsMainActivity() { | |
| onView(withId(R.id.single_intro_end_button)).perform(click()); | |
| intended(hasComponent(MainActivity.class.getName())); | |
| } | |
| } |
This file contains hidden or 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
| class IntroductionActivityTest { | |
| // Rest of the class | |
| @Test | |
| public void onLaunch_displaysAllViews() { | |
| onView(withId(R.id.single_intro_text)).check(matches(isDisplayed())); | |
| onView(withId(R.id.single_intro_end_button)).check(matches(isDisplayed())); | |
| } | |
| } |
This file contains hidden or 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 IntroductionActivityTest { | |
| @Rule | |
| public final ActivityScenarioRule<IntroductionActivity> scenarioRule | |
| = new ActivityScenarioRule<>(IntroductionActivity.class); | |
| // ...Rest of the class... | |
| } |
This file contains hidden or 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
| import androidx.test.espresso.intent.Intents; | |
| import androidx.test.ext.junit.rules.ActivityScenarioRule; | |
| import androidx.test.ext.junit.runners.AndroidJUnit4; | |
| import org.junit.After; | |
| import org.junit.Before; | |
| import org.junit.Rule; | |
| import org.junit.Test; | |
| import org.junit.runner.RunWith; |
This file contains hidden or 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 GreeterTest { | |
| @Test | |
| public void greeterSaysHello() { | |
| onView(withId(R.id.name_field)).perform(typeText("Steve")); | |
| onView(withId(R.id.greet_button)).perform(click()); | |
| onView(withText("Hello Steve!")).check(matches(isDisplayed())); | |
| } | |
| } |
This file contains hidden or 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
| dependencies { | |
| // ...Other app dependencies... | |
| // Tests | |
| def espresso_version = '3.1.1' | |
| implementation "androidx.test.espresso:espresso-idling-resource:$espresso_version" | |
| // On-device tests | |
| androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version" | |
| androidTestImplementation "androidx.test.espresso:espresso-intents:$espresso_version" |
NewerOlder